File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
bsp/stm32/libraries/HAL_Drivers Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -323,13 +323,6 @@ static rt_err_t stm32_hw_pwm_init(struct stm32_pwm *device)
323323 tim -> Init .AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE ;
324324#endif
325325
326- if (HAL_TIM_PWM_Init (tim ) != HAL_OK )
327- {
328- LOG_E ("%s pwm init failed" , device -> name );
329- result = - RT_ERROR ;
330- goto __exit ;
331- }
332-
333326 if (HAL_TIM_Base_Init (tim ) != HAL_OK )
334327 {
335328 LOG_E ("%s time base init failed" , device -> name );
@@ -345,6 +338,13 @@ static rt_err_t stm32_hw_pwm_init(struct stm32_pwm *device)
345338 goto __exit ;
346339 }
347340
341+ if (HAL_TIM_PWM_Init (tim ) != HAL_OK )
342+ {
343+ LOG_E ("%s pwm init failed" , device -> name );
344+ result = - RT_ERROR ;
345+ goto __exit ;
346+ }
347+
348348 master_config .MasterOutputTrigger = TIM_TRGO_RESET ;
349349 master_config .MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE ;
350350 if (HAL_TIMEx_MasterConfigSynchronization (tim , & master_config ) != HAL_OK )
You can’t perform that action at this time.
0 commit comments