Add in existing flight pieces: flight/report/log
[fw/altos] / ao_timer.c
index 9583a388d26983e01b0b9bdb2788ba3073d06f43..702159b73f64f0bb918a6e3417c3b971ff5c13a4 100644 (file)
@@ -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));
 }