diff options
author | Keith Packard <keithp@keithp.com> | 2009-04-25 14:44:04 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-04-25 14:44:04 -0700 |
commit | 8e7b48b5f090be81980ab00fbce814ae1cc253e4 (patch) | |
tree | 1f2fac4bd117cf21bcb545686f6722907678079b | |
parent | 7bc3d9962872850e7b420221cf689db16b4305cc (diff) |
Allow ADC to be disabled
-rw-r--r-- | ao_timer.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 |