Skip to content

Commit 2f4edc4

Browse files
Roy, ElizabethWalberg, Irun
authored andcommitted
pins_arduino.h: small changes to analogInputToDigitalPin()
1 parent 900634c commit 2f4edc4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

variants/uno2018/pins_arduino.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
#define NUM_OCCUPIED_PINS 6 // (TOSC1/2, VREF, RESET, DEBUG USART Rx/Tx)
3232
#define NUM_TOTAL_FREE_PINS (NUM_DIGITAL_PINS + NUM_ANALOG_INPUTS + NUM_TESTPOINT_PINS)
3333
#define NUM_TOTAL_PINS (NUM_DIGITAL_PINS + NUM_ANALOG_INPUTS + NUM_TESTPOINT_PINS + NUM_OCCUPIED_PINS)
34-
#define analogInputToDigitalPin(p) ((p < 6) ? (p) + 14 : NOT_A_PIN)
34+
#define ANALOG_INPUT_OFFSET 14
35+
#define analogInputToDigitalPin(p) ((p < NUM_ANALOG_INPUTS) ? (p) + ANALOG_INPUT_OFFSET : NOT_A_PIN)
3536

3637
#define digitalPinHasPWM(p) ((p) == 3 || (p) == 5 || (p) == 6 || (p) == 9 || (p) == 10 || (p) == 11)
3738

0 commit comments

Comments
 (0)