X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fstm32l0%2Fao_timer.c;h=89193333f5c32a138d2bd593ced54c2c04a1db1f;hb=3af81a45be69b4693396de4a5e2c386be566b933;hp=3b77afc0d8b397d3b71e873c539c93df0fcf657f;hpb=d907b0fe40d31995848e5b207009ba230da2e36e;p=fw%2Faltos diff --git a/src/stm32l0/ao_timer.c b/src/stm32l0/ao_timer.c index 3b77afc0..89193333 100644 --- a/src/stm32l0/ao_timer.c +++ b/src/stm32l0/ao_timer.c @@ -35,6 +35,7 @@ ao_time(void) return ao_tick_count; } +#if 0 uint64_t ao_time_ns(void) { @@ -50,6 +51,7 @@ ao_time_ns(void) return (uint64_t) after * (1000000000ULL / AO_HERTZ) + (uint64_t) cvr * (1000000000ULL / AO_SYSTICK); } +#endif #if AO_DATA_ALL volatile uint8_t ao_data_interval = 1; @@ -60,10 +62,7 @@ void stm_systick_isr(void) { if (stm_systick.csr & (1 << STM_SYSTICK_CSR_COUNTFLAG)) { ++ao_tick_count; -#if HAS_TASK_QUEUE - if (ao_task_alarm_tick && (int16_t) (ao_tick_count - ao_task_alarm_tick) >= 0) - ao_task_check_alarm((uint16_t) ao_tick_count); -#endif + ao_task_check_alarm(); #if AO_DATA_ALL if (++ao_data_count == ao_data_interval) { ao_data_count = 0; @@ -99,4 +98,10 @@ ao_timer_init(void) (STM_SYSTICK_CSR_CLKSOURCE_HCLK_8 << STM_SYSTICK_CSR_CLKSOURCE)); } +void +ao_timer_stop(void) +{ + stm_systick.csr = 0; +} + #endif