2017-09-28 03:33 PM
i don't know if it's a feature or bug, but starting a timer in interrupt mode will bring the code into the interrupt handler the first time mcu calls timer start function.
To solve this problem it's enought to clear the UIF bit from SR register right after timer initialization so there would be no pending interrupts.
But, is this safe to clear this bit?
#timer #hal #stm32 #bug #interrupt2017-09-28 03:47 PM
Update is when CNT == 0, so that's how it works.