1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 22:13:52 +01:00

cpu/stm32: fix off-by-one error in clock frequency assert

This commit is contained in:
hugues 2020-07-08 11:06:10 +02:00
parent ad28752e4e
commit 11e847c9af

View File

@ -45,7 +45,7 @@ uint32_t pwm_init(pwm_t pwm, pwm_mode_t mode, uint32_t freq, uint16_t res)
uint32_t timer_clk = periph_timer_clk(pwm_config[pwm].bus);
/* verify parameters */
assert((pwm < PWM_NUMOF) && ((freq * res) < timer_clk));
assert((pwm < PWM_NUMOF) && ((freq * res) <= timer_clk));
/* power on the used timer */
periph_clk_en(pwm_config[pwm].bus, pwm_config[pwm].rcc_mask);