From acc4fc635edb70ec1ba2dff9f7ac0c8542c72c47 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 14 Apr 2009 19:08:01 -0700 Subject: Add in existing flight pieces: flight/report/log These pieces come from the old telemetrum firmware. Signed-off-by: Keith Packard --- ao_timer.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ao_timer.c') 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)); } -- cgit v1.2.3