Skip to content

Commit 5c77b0e

Browse files
committed
added pin change interrupt defines for Leonardo. fix for broken software serial on Leonardo
1 parent b29ae7a commit 5c77b0e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: hardware/arduino/variants/leonardo/pins_arduino.h

+5
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ static const uint8_t A9 = 27; // D9
5757
static const uint8_t A10 = 28; // D10
5858
static const uint8_t A11 = 29; // D12
5959

60+
#define digitalPinToPCICR(p) (((p) >= 0 && (p) <= 21) ? (&PCICR) : ((uint8_t *)0))
61+
#define digitalPinToPCICRbit(p) (((p) <= 7) ? 2 : (((p) <= 13) ? 0 : 1))
62+
#define digitalPinToPCMSK(p) (((p) <= 7) ? (&PCMSK2) : (((p) <= 13) ? (&PCMSK0) : (((p) <= 21) ? (&PCMSK1) : ((uint8_t *)0))))
63+
#define digitalPinToPCMSKbit(p) (((p) <= 7) ? (p) : (((p) <= 13) ? ((p) - 8) : ((p) - 14)))
64+
6065
// __AVR_ATmega32U4__ has an unusual mapping of pins to channels
6166
extern const uint8_t PROGMEM analog_pin_to_channel_PGM[];
6267
#define analogPinToChannel(P) ( pgm_read_byte( analog_pin_to_channel_PGM + (P) ) )

0 commit comments

Comments
 (0)