Skip to content

Commit

Permalink
fix convertions
Browse files Browse the repository at this point in the history
  • Loading branch information
neu-rah committed Sep 13, 2018
1 parent 99ed0f8 commit d3f0986
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 36 deletions.
37 changes: 28 additions & 9 deletions examples/btnled/platformio.ini
Original file line number Diff line number Diff line change
@@ -1,18 +1,37 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Build options: build flags, source filter, extra scripting
; Upload options: custom port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html
; http://docs.platformio.org/en/stable/projectconf.html

[env:due]
platform=atmelsam
board=due
framework=arduino

[platformio]
src_dir=btnled
lib_dir=~/Arduino/Libraries

[env:nanoatmega328]
platform = atmelavr
board = nanoatmega328
framework = arduino
upload_port=/dev/ttyUSB*
upload_flags=-V
build_flags = -DDEBUG

; [env:uno]
; platform = atmelavr
; board = nanoatmega328
; framework = arduino

; [env:due]
; platform = atmelsam
; board = due
; framework = arduino
; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined

; [env:teensy31]
; platform = teensy
; board = teensy31
; framework = arduino
; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -Wno-switch
4 changes: 4 additions & 0 deletions examples/mkPCIntMap/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.pioenvs
.piolibdeps
.clang_complete
.gcc-flags.json
File renamed without changes.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=PCINT r-site.net
version=4.0.6
version=4.0.7
author=Rui Azevedo, [email protected]
maintainer=neu-rah, [email protected]
sentence=Arduino Pin change monitor
Expand Down
18 changes: 0 additions & 18 deletions platformio.ini

This file was deleted.

2 changes: 1 addition & 1 deletion src/pcint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifdef PCINT_NO_MAPS
HANDLER_TYPE PCintFunc[NUM_DIGITAL_PINS];
template<int N> void PCint() {PCintFunc[N]();}
//static voidFuncPtr PCints[NUM_DIGITAL_PINS];
//static voidFuncPtr PCints[NUM_DIGITAL_PINS];
//PCints[0]=PCint<0>;
//PCints[1]=PCint<1>;
#else
Expand Down
12 changes: 5 additions & 7 deletions src/pcint.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,23 @@ Nov.2014 large changes
#endif
defined(RSITE_TEENSY3) || defined(ARDUINO_SAM_DUE)*/

#if defined(__arm__) || defined(ESP8266)
#if defined(__arm__) || defined(ESP8266) || defined(ESP32)
#warning Compiling for arm
#define PCINT_NO_MAPS
#endif

#ifndef PCINT_NO_MAPS
// PCINT reverse map
// because some avr's (like 2560) have a messed map we got to have this detailed pin reverse map
// still this makes the PCINT automatization very slow, risking interrupt collision
// PCINT reverse map
#if defined(digital_pin_to_pcint)
#define digitalPinFromPCINTSlot(slot,bit) pgm_read_byte(digital_pin_to_pcint+(((slot)<<3)+(bit)))
#define pcintPinMapBank(slot) ((uint8_t*)((uint8_t*)digital_pin_to_pcint+((slot)<<3)))
#else
#warning using maps!
#if ( defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega16u4__) )
//UNO
const uint8_t pcintPinMap[3][8] PROGMEM={{8,9,10,11,12,13,-1,-1},{14,15,16,17,18,19,20,21},{0,1,2,3,4,5,6,7}};
const uint8_t pcintPinMap[3][8] PROGMEM={{8,9,10,11,12,13,0x80,0x80},{14,15,16,17,18,19,20,21},{0,1,2,3,4,5,6,7}};
#elif ( defined(__AVR_ATmega2560__) )
const uint8_t pcintPinMap[3][8] PROGMEM={{53,52,51,50,10,11,12,13},{0,15,14,-1,-1,-1,-1,-1},{A8,A9,A10,A11,A12,A13,A14,A15}};
const uint8_t pcintPinMap[3][8] PROGMEM={{53,52,51,50,10,11,12,13},{0,15,14,0x80,0x80,0x80,0x80,0x80},{A8,A9,A10,A11,A12,A13,A14,A15}};
#elif ( defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega1284__) || defined(__AVR_ATmega644__))
#error "uC PCINT REVERSE MAP IS NOT DEFINED, ATmega1284P variant unknown"
//run the mkPCIntMap example to obtain a map for your board!
Expand Down Expand Up @@ -93,7 +91,7 @@ Nov.2014 large changes
// common code for isr handler. "port" is the PCINT number.
// there isn't really a good way to back-map ports and masks to pins.
// here we consider only the first change found ignoring subsequent, assuming no interrupt cascade
static void PCint(uint8_t port);
// static void PCint(uint8_t port);

#endif
/*
Expand Down

0 comments on commit d3f0986

Please sign in to comment.