[bsp][stm32] Add HAL_TIM_Base_Init

This commit is contained in:
Zhaoxing Li 2021-01-19 14:02:31 +08:00
parent 0fb6a82223
commit bda4b68a80
1 changed files with 6 additions and 0 deletions

View File

@ -327,6 +327,12 @@ static rt_err_t stm32_hw_pwm_init(struct stm32_pwm *device)
tim->Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
#endif
if (HAL_TIM_Base_Init(tim) != HAL_OK)
{
LOG_E("%s pwm init failed", device->name);
result = -RT_ERROR;
goto __exit;
}
if (HAL_TIM_PWM_Init(tim) != HAL_OK)
{
LOG_E("%s pwm init failed", device->name);