From 8e7b48b5f090be81980ab00fbce814ae1cc253e4 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 25 Apr 2009 14:44:04 -0700 Subject: [PATCH 1/1] Allow ADC to be disabled --- ao_timer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ao_timer.c b/ao_timer.c index eee5a6d4..a6a7646f 100644 --- a/ao_timer.c +++ b/ao_timer.c @@ -42,7 +42,7 @@ volatile __data uint8_t ao_adc_count; void ao_timer_isr(void) interrupt 9 { ++ao_tick_count; - if (++ao_adc_count >= ao_adc_interval) { + if (++ao_adc_count == ao_adc_interval) { ao_adc_count = 0; ao_adc_poll(); } @@ -53,6 +53,7 @@ void ao_timer_set_adc_interval(uint8_t interval) __critical { ao_adc_interval = interval; + ao_adc_count = 0; } void -- 2.30.2