From 5ca0ed94f30943952b9c63ee558733d37c896b5f Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 8 Nov 2022 16:17:58 -0800 Subject: [PATCH] samd21: Hook up AltOS timer functionality Need to run the data sampling stuff. Signed-off-by: Keith Packard --- src/samd21/ao_timer.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/samd21/ao_timer.c b/src/samd21/ao_timer.c index 0eb0dbea..2b431d38 100644 --- a/src/samd21/ao_timer.c +++ b/src/samd21/ao_timer.c @@ -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 -- 2.30.2