Explorar o código

[stm32][driver] pwm enable clock

Wu Han %!s(int64=5) %!d(string=hai) anos
pai
achega
6a1e12f178
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      bsp/stm32/libraries/HAL_Drivers/drv_pwm.c

+ 3 - 0
bsp/stm32/libraries/HAL_Drivers/drv_pwm.c

@@ -314,6 +314,9 @@ static rt_err_t stm32_hw_pwm_init(struct stm32_pwm *device)
 
     tim = (TIM_HandleTypeDef *)&device->tim_handle;
 
+    /* enable timer clock */
+    HAL_TIM_PWM_MspInit(tim);
+
     /* configure the timer to pwm mode */
     tim->Init.Prescaler = 0;
     tim->Init.CounterMode = TIM_COUNTERMODE_UP;