Skip to content

Commit 9b2e698

Browse files
authored
Merge pull request arduino#125 from GMagician/Fix-analogInputToDigitalPin
Fix analogInputToDigitalPin for Grand Central M4
2 parents b2cf1b1 + 3c70733 commit 9b2e698

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

variants/grand_central_m4/variant.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ extern "C"
6161
#define NUM_DIGITAL_PINS (53u)
6262
#define NUM_ANALOG_INPUTS (16u)
6363
#define NUM_ANALOG_OUTPUTS (2u)
64-
#define analogInputToDigitalPin(p) ((p < 6u) ? (p) + 14u : -1)
64+
#define analogInputToDigitalPin(p) ((p < 8) ? 67 + (p) : (p < 16) ? 54 + (p) - 8 : (p < 18) ? 12 + (p) - 16 : (p == 18) ? 9 : -1)
6565

6666
#define digitalPinToPort(P) ( &(PORT->Group[g_APinDescription[P].ulPort]) )
6767
#define digitalPinToBitMask(P) ( 1 << g_APinDescription[P].ulPin )

0 commit comments

Comments
 (0)