summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-04-25 14:44:04 -0700
committerKeith Packard <keithp@keithp.com>2009-04-25 14:44:04 -0700
commit8e7b48b5f090be81980ab00fbce814ae1cc253e4 (patch)
tree1f2fac4bd117cf21bcb545686f6722907678079b
parent7bc3d9962872850e7b420221cf689db16b4305cc (diff)
Allow ADC to be disabled
-rw-r--r--ao_timer.c3
1 files changed, 2 insertions, 1 deletions
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