summaryrefslogtreecommitdiff
path: root/ao_timer.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-04-14 19:08:01 -0700
committerKeith Packard <keithp@keithp.com>2009-04-14 19:08:01 -0700
commitacc4fc635edb70ec1ba2dff9f7ac0c8542c72c47 (patch)
treede8ce5e1cdfb925cfdb3be15e75c7e3e1c4d5c52 /ao_timer.c
parentac99982b10fd5772218660137ee21db9b90cd885 (diff)
Add in existing flight pieces: flight/report/log
These pieces come from the old telemetrum firmware. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao_timer.c')
-rw-r--r--ao_timer.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ao_timer.c b/ao_timer.c
index 9583a388..702159b7 100644
--- a/ao_timer.c
+++ b/ao_timer.c
@@ -42,10 +42,16 @@ ao_delay(uint16_t ticks)
#define T1_CLOCK_DIVISOR 8 /* 24e6/8 = 3e6 */
#define T1_SAMPLE_TIME 30000 /* 3e6/30000 = 100 */
+__data uint8_t ao_adc_interval = 1;
+__data uint8_t ao_adc_count;
+
void ao_timer_isr(void) interrupt 9
{
++ao_tick_count;
- ao_adc_poll();
+ if (++ao_adc_count >= ao_adc_interval) {
+ ao_adc_count = 0;
+ ao_adc_poll();
+ }
ao_wakeup(DATA_TO_XDATA(&ao_tick_count));
}