diff --git a/src/avr/gpio.c b/src/avr/gpio.c index 5dfc34c4..aa39f957 100644 --- a/src/avr/gpio.c +++ b/src/avr/gpio.c @@ -258,7 +258,7 @@ static const uint8_t adc_pins[] PROGMEM = { static const uint8_t ADMUX_DEFAULT = 0x40; -DECL_CONSTANT(ADC_MAX, 1024); +DECL_CONSTANT(ADC_MAX, 1023); struct gpio_adc gpio_adc_setup(uint8_t pin) diff --git a/src/sam3x8e/gpio.c b/src/sam3x8e/gpio.c index d20f3f77..205528d5 100644 --- a/src/sam3x8e/gpio.c +++ b/src/sam3x8e/gpio.c @@ -128,7 +128,7 @@ static const uint8_t adc_pins[] = { }; #define ADC_FREQ_MAX 20000000 -DECL_CONSTANT(ADC_MAX, 4096); +DECL_CONSTANT(ADC_MAX, 4095); struct gpio_adc gpio_adc_setup(uint8_t pin)