LowPowerLab / Moteino

Moteino Eagle project and library
130 stars 67 forks source link

pins_arduino.h improvements #2

Open stefanrueger opened 8 years ago

stefanrueger commented 8 years ago

The pins_arduino.h in Moteino/MEGA/Core/Moteino.zip

can be improved:

Easy fixes throughout. Here a diff -e of mine with the existing

72a

define digitalPinToInterrupt(p) ((p) == 10? 0: (p) == 11? 1: (p) == 2? 2: NOT_AN_INTERRUPT)

. 58a

define LED_BUILTIN 15

. 41c

define NUM_DIGITAL_PINS 32

. 17c // PCINT12/OC0B/SS (D4 ) PB4 5|~ |36 PA4 (A4 / D28)/PCINT4 .

stefanrueger commented 8 years ago

... more problems: digitalPinToPCMSK(p) is plain wrong (it's a copy from ATmega328P). Should be

define digitalPinToPCMSK(p) (((p) <= 7)? (&PCMSK1): ((p) <= 15)? (&PCMSK3): ((p) <= 23)? (&PCMSK2): (&PCMSK0))

jedon commented 7 years ago

Thank you, that fixed my compile error!