STM32 ONE PULSE MODE.
In one of my projects I used the following mechanism to control a buzzer: I turned it on manually, started a timer and turned it off in the interrupt triggered by the timer overflow. Over time the number of interrupts in the project grew, and other interrupts often prevented the one that turned off the buzzer from firing. As a result, the buzzer always produced a beep of varying length...