X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fstm32f4%2Fao_timer.c;h=83ffe4a76a247db1c1080b1c677183d153c94931;hb=59cbf80e63b4c88de45e59c6e3d209f99910fcf3;hp=d6ef9bc379e5d074b68bb98506957f46ce94e599;hpb=0686a7b8aec524d81bda4c572549a3a068ce0eed;p=fw%2Faltos diff --git a/src/stm32f4/ao_timer.c b/src/stm32f4/ao_timer.c index d6ef9bc3..83ffe4a7 100644 --- a/src/stm32f4/ao_timer.c +++ b/src/stm32f4/ao_timer.c @@ -47,12 +47,9 @@ void stm_systick_isr(void) #if HAS_TICK ++ao_tick_count; #endif -#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) { + if (++ao_data_count == ao_data_interval && ao_data_interval) { ao_data_count = 0; #if HAS_FAKE_FLIGHT if (ao_fake_flight_active) @@ -262,13 +259,12 @@ ao_clock_init(void) #if DEBUG_THE_CLOCK /* Output PLL clock on PA8 and SYCLK on PC9 for measurments */ - stm_rcc.ahb1enr |= ((1 << STM_RCC_AHB1ENR_IOPAEN) | - (1 << STM_RCC_AHB1ENR_IOPCEN)); - + ao_enable_port(&stm_gpioa); stm_afr_set(&stm_gpioa, 8, STM_AFR_AF0); stm_moder_set(&stm_gpioa, 8, STM_MODER_ALTERNATE); stm_ospeedr_set(&stm_gpioa, 8, STM_OSPEEDR_HIGH); + ao_enable_port(&stm_gpioc); stm_afr_set(&stm_gpioc, 9, STM_AFR_AF0); stm_moder_set(&stm_gpioc, 9, STM_MODER_ALTERNATE); stm_ospeedr_set(&stm_gpioc, 9, STM_OSPEEDR_HIGH);