Skip to content

Commit 7354f0e

Browse files
committed
Fixed handling of Ax constants on Leonardo
Fixed mistake in assignment and handling of A6-A11 constants. Renumbered constants for all Ax channels.
1 parent 20e68d2 commit 7354f0e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

hardware/arduino/cores/arduino/wiring_analog.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ int analogRead(uint8_t pin)
4343

4444
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
4545
if (pin >= 54) pin -= 54; // allow for channel or pin numbers
46+
#elif defined(__AVR_ATmega32U4__)
47+
if (pin >= 18) pin -= 18; // allow for channel or pin numbers
4648
#else
4749
if (pin >= 14) pin -= 14; // allow for channel or pin numbers
4850
#endif

0 commit comments

Comments
 (0)