diff options
| author | Bernard Xiong <[email protected]> | 2019-09-04 08:03:28 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-09-04 08:03:28 +0800 |
| commit | 03f8762e28f0b3bb251cc4bba26aa9866a3bce28 (patch) | |
| tree | 014d3cef3e5f9bfff5544d094ac62da77e2bdc09 | |
| parent | 9573b6c01392135663ba2e78c5b5753902b0f83d (diff) | |
| parent | 0c1a12afd8a70e98cc7b910bd8c7854167a3251c (diff) | |
Merge pull request #2989 from yexinfu/master
[bsp][stm32][HAL_Drivers]modified stm32 timer_start cant set HWTIMER_MODE_PERIOD mode
| -rw-r--r-- | bsp/stm32/libraries/HAL_Drivers/drv_hwtimer.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_hwtimer.c b/bsp/stm32/libraries/HAL_Drivers/drv_hwtimer.c index 085674d3c5..24e91cd690 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_hwtimer.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_hwtimer.c @@ -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 */ tim->Instance->CR1 |= TIM_OPMODE_SINGLE; } - + else + { + tim->Instance->CR1 &= (~TIM_OPMODE_SINGLE); + } + /* start timer */ if (HAL_TIM_Base_Start_IT(tim) != HAL_OK) { - LOG_E("TIM2 start failed"); + LOG_E("TIM start failed"); result = -RT_ERROR; } |
