aboutsummaryrefslogtreecommitdiff
path: root/variants/leonardo/pins_arduino.h
diff options
context:
space:
mode:
authorZach Eveland <zeveland@blacklabel-development.com>2012-05-19 22:05:46 -0400
committerZach Eveland <zeveland@blacklabel-development.com>2012-05-19 22:05:46 -0400
commite346d868b92b431507487b0de57b746477a80bec (patch)
treeb8a71972f328a6afd23d51e32affc1b384188807 /variants/leonardo/pins_arduino.h
parentefa75937723c2b868ddb7cec93a0a3bf6fa01959 (diff)
added pin change interrupt defines for Leonardo. fix for broken software serial on Leonardo
Diffstat (limited to 'variants/leonardo/pins_arduino.h')
-rw-r--r--variants/leonardo/pins_arduino.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/variants/leonardo/pins_arduino.h b/variants/leonardo/pins_arduino.h
index ff9e4f9..d5b32d0 100644
--- a/variants/leonardo/pins_arduino.h
+++ b/variants/leonardo/pins_arduino.h
@@ -57,6 +57,11 @@ 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)))
+
// __AVR_ATmega32U4__ has an unusual mapping of pins to channels
extern const uint8_t PROGMEM analog_pin_to_channel_PGM[];
#define analogPinToChannel(P) ( pgm_read_byte( analog_pin_to_channel_PGM + (P) ) )