Merge pull request #3050 from ericQiang/master

bug fix: the value of timer auto reload should be (val-1)
This commit is contained in:
Bernard Xiong 2019-09-16 17:36:23 +08:00 committed by GitHub
commit bb014b2061
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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; tim = (TIM_HandleTypeDef *)timer->parent.user_data;
/* set tim cnt */ /* set tim cnt */
__HAL_TIM_SET_AUTORELOAD(tim, t); __HAL_TIM_SET_AUTORELOAD(tim, t - 1);
if (opmode == HWTIMER_MODE_ONESHOT) if (opmode == HWTIMER_MODE_ONESHOT)
{ {