samd21: Hook up AltOS timer functionality
authorKeith Packard <keithp@keithp.com>
Wed, 9 Nov 2022 00:17:58 +0000 (16:17 -0800)
committerKeith Packard <keithp@keithp.com>
Wed, 9 Nov 2022 00:17:58 +0000 (16:17 -0800)
Need to run the data sampling stuff.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/samd21/ao_timer.c

index 0eb0dbeacc40c48b8977e4e4ea4c1ab7f243b4fa..2b431d38ada440fa3581d8e46b3237158b69a2b7 100644 (file)
@@ -53,6 +53,21 @@ void samd21_systick_isr(void)
        ao_arch_release_interrupts();
        if (samd21_systick.csr & (1 << SAMD21_SYSTICK_CSR_COUNTFLAG)) {
                ++ao_tick_count;
+               ao_task_check_alarm();
+#if AO_DATA_ALL
+               if (++ao_data_count == ao_data_interval && ao_data_interval) {
+                       ao_data_count = 0;
+#if HAS_FAKE_FLIGHT
+                       if (ao_fake_flight_active)
+                               ao_fake_flight_poll();
+                       else
+#endif
+                               ao_adc_poll();
+#if (AO_DATA_ALL & ~(AO_DATA_ADC))
+                       ao_wakeup((void *) &ao_data_count);
+#endif
+               }
+#endif
 #ifdef AO_TIMER_HOOK
                AO_TIMER_HOOK;
 #endif