Skip to content

Commit 65436c8

Browse files
committed
Correcting analogReference() constants for ATtiny24/44/84 and 25/45/85.
DEFAULT, EXTERNAL, and INTERNAL have different values on those processors.
1 parent 66864b1 commit 65436c8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

hardware/arduino/cores/arduino/Arduino.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ extern "C"{
4040
#define FALLING 2
4141
#define RISING 3
4242

43+
#if defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)
44+
#define DEFAULT 0
45+
#define EXTERNAL 1
46+
#define INTERNAL 2
47+
#else
4348
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
4449
#define INTERNAL1V1 2
4550
#define INTERNAL2V56 3
@@ -48,6 +53,7 @@ extern "C"{
4853
#endif
4954
#define DEFAULT 1
5055
#define EXTERNAL 0
56+
#endif
5157

5258
// undefine stdlib's abs if encountered
5359
#ifdef abs

0 commit comments

Comments
 (0)