-
Hello, One can see that the Update Interrupt Flag (UIF) for the timer in question is not cleared by the generic update callback function. My suggestion is that the UIF flag should be cleared and that this should be documented in wiki, that there is no need for the user callback function to manually clear this flag. The purpose of having the flag cleared automatically by the callback function is that the flag can then be tested by user code to check if the user callback function has executed or not, consequently we know if there was an update event and that it has already been handled by the user callback function. I have checked the programming manual and the UIF is not cleared by hardware, only by software. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
In fact, UIF flag is cleared:
Flag is cleared in HAL_TIM_IRQHandler() before calling HAL_TIM_PeriodElapsedCallback() |
Beta Was this translation helpful? Give feedback.
-
Ah, my bad! |
Beta Was this translation helpful? Give feedback.
In fact, UIF flag is cleared:
HardwareTimer library is based on STM32 HAL driver, and this is the place where UIF flag is cleared.
Below is an example of call stack when Timer interrupt occurs:
Flag is cleared in HAL_TIM_IRQHandler() before calling HAL_TIM_PeriodElapsedCallback()
Arduino_Core_STM32/system/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c
Line 3860 in 75d6531