Skip to content

Commit 8e82103

Browse files
committed
Correct NUM_DIGITAL_PINS to include analog pins
1 parent d44eee2 commit 8e82103

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

variants/arduino_due_x/variant.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ extern "C"{
5656

5757
// Number of pins defined in PinDescription array
5858
#define PINS_COUNT (79u)
59-
#define NUM_DIGITAL_PINS (54u)
59+
#define NUM_DIGITAL_PINS (66u)
6060
#define NUM_ANALOG_INPUTS (12u)
61-
#define analogInputToDigitalPin(p) ((p < NUM_ANALOG_INPUTS) ? (p) + NUM_DIGITAL_PINS : -1)
61+
#define analogInputToDigitalPin(p) ((p < 12u) ? (p) + 54u : -1)
6262

6363
#define digitalPinToPort(P) ( g_APinDescription[P].pPort )
6464
#define digitalPinToBitMask(P) ( g_APinDescription[P].ulPin )

0 commit comments

Comments
 (0)