aboutsummaryrefslogtreecommitdiffstats
path: root/src/avr
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-05-07 17:36:02 -0400
committerKevin O'Connor <kevin@koconnor.net>2017-05-15 14:02:59 -0400
commita361b921849b4e23f7a41feb2a7c011ee6d794b1 (patch)
treef379c892f54f7a9935e961c441a2ce6182da6ca8 /src/avr
parent37572bc2174432df133a8d2fed2cded0a4fcbd54 (diff)
downloadkutter-a361b921849b4e23f7a41feb2a7c011ee6d794b1.tar.gz
kutter-a361b921849b4e23f7a41feb2a7c011ee6d794b1.tar.xz
kutter-a361b921849b4e23f7a41feb2a7c011ee6d794b1.zip
gpio: Fix off-by-one in declaration of ADC_MAX
The maximum value for the ADC is 1023 for 10bit samples and 4095 for 12bit samples. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/avr')
-rw-r--r--src/avr/gpio.c2
1 files changed, 1 insertions, 1 deletions
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)