修复stm32 timer_start函数不能设置HWTIMER_MODE_PERIOD模式
修复timer_start函数注释:将TIM2改为TIM更合理
This commit is contained in:
parent
200f3d4480
commit
0c1a12afd8
|
@ -235,11 +235,15 @@ static rt_err_t timer_start(rt_hwtimer_t *timer, rt_uint32_t t, rt_hwtimer_mode_
|
||||||
/* set timer to single mode */
|
/* set timer to single mode */
|
||||||
tim->Instance->CR1 |= TIM_OPMODE_SINGLE;
|
tim->Instance->CR1 |= TIM_OPMODE_SINGLE;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tim->Instance->CR1 &= (~TIM_OPMODE_SINGLE);
|
||||||
|
}
|
||||||
|
|
||||||
/* start timer */
|
/* start timer */
|
||||||
if (HAL_TIM_Base_Start_IT(tim) != HAL_OK)
|
if (HAL_TIM_Base_Start_IT(tim) != HAL_OK)
|
||||||
{
|
{
|
||||||
LOG_E("TIM2 start failed");
|
LOG_E("TIM start failed");
|
||||||
result = -RT_ERROR;
|
result = -RT_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue