Explorar o código

[bug] fix tim bug

liYony %!s(int64=3) %!d(string=hai) anos
pai
achega
190eda6ab0
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      bsp/stm32/libraries/HAL_Drivers/drv_tim.c

+ 1 - 1
bsp/stm32/libraries/HAL_Drivers/drv_tim.c

@@ -212,7 +212,7 @@ static void timer_init(struct rt_hwtimer_device *timer, rt_uint32_t state)
 #if defined(APBPERIPH_BASE)
         prescaler_value = (uint32_t)(HAL_RCC_GetPCLK1Freq() * pclk1_doubler / 10000) - 1;
 #elif defined(APB1PERIPH_BASE) || defined(APB2PERIPH_BASE)
-        if ((rt_uint32_t)htim->Instance >= APB2PERIPH_BASE)
+        if ((rt_uint32_t)tim->Instance >= APB2PERIPH_BASE)
         {
             prescaler_value = (uint32_t)(HAL_RCC_GetPCLK2Freq() * pclk2_doubler / 10000) - 1;
         }