mirror of https://github.com/RT-Thread/rt-thread
[stm32] Fix Assertion Failure in HAL Library Due to Period=0 During PWM Initialization
Co-authored-by: wdfk-prog <1425075683@qq.com>
This commit is contained in:
parent
3d72290b38
commit
dc225f3f83
|
@ -374,7 +374,7 @@ static rt_err_t stm32_hw_pwm_init(struct stm32_pwm *device)
|
|||
/* configure the timer to pwm mode */
|
||||
tim->Init.Prescaler = 0;
|
||||
tim->Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
tim->Init.Period = 0;
|
||||
tim->Init.Period = 1;
|
||||
tim->Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
#if defined(SOC_SERIES_STM32F1) || defined(SOC_SERIES_STM32L4)
|
||||
tim->Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||
|
|
Loading…
Reference in New Issue