mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-29 18:52:13 +01:00
Check if ATmega32u4 is defined
Needed in order to work with Arduino Leonardo
This commit is contained in:
parent
72ec50717d
commit
59c5b94c51
@ -42,6 +42,9 @@ int analogRead(uint8_t pin)
|
||||
uint8_t low, high;
|
||||
|
||||
#if defined(analogPinToChannel)
|
||||
#if defined(__AVR_ATmega32U4__)
|
||||
if (pin >= 18) pin -= 18; // allow for channel or pin numbers
|
||||
#endif
|
||||
pin = analogPinToChannel(pin);
|
||||
#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
|
||||
if (pin >= 54) pin -= 54; // allow for channel or pin numbers
|
||||
|
Loading…
x
Reference in New Issue
Block a user