From: Keith Packard Date: Sat, 25 Apr 2009 21:44:04 +0000 (-0700) Subject: Allow ADC to be disabled X-Git-Tag: 0.1~9 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=8e7b48b5f090be81980ab00fbce814ae1cc253e4 Allow ADC to be disabled --- 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