Skip to content

Commit ef9cba6

Browse files
Roy, ElizabethWalberg, Irun
authored andcommitted
Small change for analog_reference hash-defines
1 parent 32f9ae8 commit ef9cba6

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

cores/arduino/Arduino.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ extern "C"{
4141
*/
4242

4343
// internal from VREF
44-
// external from VREF pin
4544

46-
#define INTERNAL0V55 0x0
47-
#define INTERNAL1V1 0x1
48-
#define INTERNAL2V5 0x2
49-
#define INTERNAL4V3 0x3
50-
#define INTERNAL1V5 0x4
45+
/* Values shifted to avoid clashing with ADC REFSEL defines
46+
Will shift back in analog_reference function
47+
*/
48+
#define INTERNAL0V55 (VREF_ADC0REFSEL_0V55_gc >> VREF_ADC0REFSEL_gp)
49+
#define INTERNAL1V1 (VREF_ADC0REFSEL_1V1_gc >> VREF_ADC0REFSEL_gp)
50+
#define INTERNAL2V5 (VREF_ADC0REFSEL_2V5_gc >> VREF_ADC0REFSEL_gp)
51+
#define INTERNAL4V3 (VREF_ADC0REFSEL_4V34_gc >> VREF_ADC0REFSEL_gp)
52+
#define INTERNAL1V5 (VREF_ADC0REFSEL_1V5_gc >> VREF_ADC0REFSEL_gp)
5153

5254
#define DEFAULT INTERNAL0V55
5355
#define INTERNAL ADC_REFSEL_INTREF_gc

0 commit comments

Comments
 (0)