X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao_timer.c;h=702159b73f64f0bb918a6e3417c3b971ff5c13a4;hp=9583a388d26983e01b0b9bdb2788ba3073d06f43;hb=acc4fc635edb70ec1ba2dff9f7ac0c8542c72c47;hpb=ac99982b10fd5772218660137ee21db9b90cd885 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)); }