diff options
| author | ericQiang <[email protected]> | 2019-09-09 22:22:29 +0800 |
|---|---|---|
| committer | ericQiang <[email protected]> | 2019-09-09 22:22:29 +0800 |
| commit | ee668cce81f97645ba84d93efe565e81cd8a80b4 (patch) | |
| tree | 743969f326c1feb0dd401c3a35e95525177b0e10 /bsp | |
| parent | 4ba5fe5ab5e7f38ff36c579fa5406d9c113a9e8d (diff) | |
bug fix: the value of timer auto reload should be (val-1)
Diffstat (limited to 'bsp')
| -rw-r--r-- | bsp/stm32/libraries/HAL_Drivers/drv_hwtimer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_hwtimer.c b/bsp/stm32/libraries/HAL_Drivers/drv_hwtimer.c index 24e91cd690..52fa5c84fa 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_hwtimer.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_hwtimer.c @@ -228,7 +228,7 @@ static rt_err_t timer_start(rt_hwtimer_t *timer, rt_uint32_t t, rt_hwtimer_mode_ tim = (TIM_HandleTypeDef *)timer->parent.user_data; /* set tim cnt */ - __HAL_TIM_SET_AUTORELOAD(tim, t); + __HAL_TIM_SET_AUTORELOAD(tim, t - 1); if (opmode == HWTIMER_MODE_ONESHOT) { |
