aboutsummaryrefslogtreecommitdiff
path: root/variants/leonardo/pins_arduino.h
diff options
context:
space:
mode:
authorCristian Maglie <c.maglie@bug.st>2012-05-23 09:22:52 +0200
committerCristian Maglie <c.maglie@bug.st>2012-05-23 09:22:52 +0200
commita3dbb49c078176fca1610f4a61b0d1b23e3f37c9 (patch)
tree97c6f70b3f54da526db9acf93ed0b4ef24248b4e /variants/leonardo/pins_arduino.h
parent3786e337e0211ca1ef94b37b03e891adfb3b5f9a (diff)
parent810803c6d3ab33a4496a89f41ef7e1dda15e8680 (diff)
Merge of arduino-1.0.1. Work in progress...
Diffstat (limited to 'variants/leonardo/pins_arduino.h')
-rw-r--r--variants/leonardo/pins_arduino.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/variants/leonardo/pins_arduino.h b/variants/leonardo/pins_arduino.h
index 5a15146..9f770d6 100644
--- a/variants/leonardo/pins_arduino.h
+++ b/variants/leonardo/pins_arduino.h
@@ -27,8 +27,6 @@
#include <avr/pgmspace.h>
-#define ARDUINO_MODEL_USB_PID 0x0034
-
#define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0)
#define TXLED0 PORTD |= (1<<5)
#define TXLED1 PORTD &= ~(1<<5)
@@ -59,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) >= 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[];
#define analogPinToChannel(P) ( pgm_read_byte( analog_pin_to_channel_PGM + (P) ) )
@@ -212,7 +215,7 @@ const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[30] = {
_BV(6), // D29 / D12 - A11 - PD6
};
-const uint8_t PROGMEM digital_pin_to_timer_PGM[18] = {
+const uint8_t PROGMEM digital_pin_to_timer_PGM[16] = {
NOT_ON_TIMER,
NOT_ON_TIMER,
NOT_ON_TIMER,