diff --git a/src/drivers/stm32/drv_io_timer.c b/src/drivers/stm32/drv_io_timer.c index f078cf83fc..a993db8e95 100644 --- a/src/drivers/stm32/drv_io_timer.c +++ b/src/drivers/stm32/drv_io_timer.c @@ -457,7 +457,7 @@ static int timer_set_rate(unsigned timer, unsigned rate) { /* configure the timer to update at the desired rate */ - rARR(timer) = BOARD_PWM_FREQ / rate; + rARR(timer) = (BOARD_PWM_FREQ / rate) - 1; /* generate an update event; reloads the counter and all registers */ rEGR(timer) = GTIM_EGR_UG;