提交 190eda6a 编写于 作者: L liYony 提交者: mysterywolf

[bug] fix tim bug

上级 4bbfc5fc
...@@ -212,7 +212,7 @@ static void timer_init(struct rt_hwtimer_device *timer, rt_uint32_t state) ...@@ -212,7 +212,7 @@ static void timer_init(struct rt_hwtimer_device *timer, rt_uint32_t state)
#if defined(APBPERIPH_BASE) #if defined(APBPERIPH_BASE)
prescaler_value = (uint32_t)(HAL_RCC_GetPCLK1Freq() * pclk1_doubler / 10000) - 1; prescaler_value = (uint32_t)(HAL_RCC_GetPCLK1Freq() * pclk1_doubler / 10000) - 1;
#elif defined(APB1PERIPH_BASE) || defined(APB2PERIPH_BASE) #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; prescaler_value = (uint32_t)(HAL_RCC_GetPCLK2Freq() * pclk2_doubler / 10000) - 1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册