aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-12-22 23:58:51 -0500
committerKevin O'Connor <kevin@koconnor.net>2016-12-23 17:06:10 -0500
commit872b08601a6b749de2f83b3f270a2c311dd22bbc (patch)
treed0525ecde954a6e7548e617da143dbf2d54652b9 /src
parentfe95ea221b2b88e9cb52a6378ff2018ee752094b (diff)
downloadkutter-872b08601a6b749de2f83b3f270a2c311dd22bbc.tar.gz
kutter-872b08601a6b749de2f83b3f270a2c311dd22bbc.tar.xz
kutter-872b08601a6b749de2f83b3f270a2c311dd22bbc.zip
mcu: Obtain the maximum adc value from the firmware
Don't assume the hardware ADC has 10bit resultion - instead have the firmware define a constant and read that constant in the host. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src')
-rw-r--r--src/avr/gpio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/avr/gpio.c b/src/avr/gpio.c
index 3df6e9e8..69114f05 100644
--- a/src/avr/gpio.c
+++ b/src/avr/gpio.c
@@ -258,6 +258,8 @@ gpio_pwm_setup(uint8_t pin, uint32_t cycle_time, uint8_t val)
}
+DECL_CONSTANT(ADC_MAX, 1024);
+
struct gpio_adc
gpio_adc_setup(uint8_t pin)
{