diff options
author | David A. Mellis <d.mellis@arduino.cc> | 2012-05-20 15:56:49 -0700 |
---|---|---|
committer | David A. Mellis <d.mellis@arduino.cc> | 2012-05-20 15:56:49 -0700 |
commit | 3e68702149cbf938f11bc9410eb7f9a0c811fa28 (patch) | |
tree | 69edfbece9aae30a0b65bb1678d375bc26e728b4 | |
parent | e346d868b92b431507487b0de57b746477a80bec (diff) |
Updating SoftwareSerial pin mapping (pin change interrupts) for Leonardo.
-rw-r--r-- | variants/leonardo/pins_arduino.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/variants/leonardo/pins_arduino.h b/variants/leonardo/pins_arduino.h index d5b32d0..9f770d6 100644 --- a/variants/leonardo/pins_arduino.h +++ b/variants/leonardo/pins_arduino.h @@ -57,10 +57,10 @@ static const uint8_t A9 = 27; // D9 static const uint8_t A10 = 28; // D10 static const uint8_t A11 = 29; // D12 -#define digitalPinToPCICR(p) (((p) >= 0 && (p) <= 21) ? (&PCICR) : ((uint8_t *)0)) -#define digitalPinToPCICRbit(p) (((p) <= 7) ? 2 : (((p) <= 13) ? 0 : 1)) -#define digitalPinToPCMSK(p) (((p) <= 7) ? (&PCMSK2) : (((p) <= 13) ? (&PCMSK0) : (((p) <= 21) ? (&PCMSK1) : ((uint8_t *)0)))) -#define digitalPinToPCMSKbit(p) (((p) <= 7) ? (p) : (((p) <= 13) ? ((p) - 8) : ((p) - 14))) +#define digitalPinToPCICR(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCICR) : ((uint8_t *)0)) +#define digitalPinToPCICRbit(p) 0 +#define digitalPinToPCMSK(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCMSK0) : ((uint8_t *)0)) +#define digitalPinToPCMSKbit(p) ( ((p) >= 8 && (p) <= 11) ? (p) - 4 : ((p) == 14 ? 3 : ((p) == 15 ? 1 : ((p) == 16 ? 2 : ((p) == 17 ? 0 : (p - A8 + 4)))))) // __AVR_ATmega32U4__ has an unusual mapping of pins to channels extern const uint8_t PROGMEM analog_pin_to_channel_PGM[]; |