From: Keith Packard Date: Wed, 9 Nov 2022 00:17:58 +0000 (-0800) Subject: samd21: Hook up AltOS timer functionality X-Git-Tag: 1.9.13~1^2~26^2~27 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=5ca0ed94f30943952b9c63ee558733d37c896b5f samd21: Hook up AltOS timer functionality Need to run the data sampling stuff. Signed-off-by: Keith Packard --- 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