Skip to content

Commit ebf3f83

Browse files
committed
sunxi-hal use periodTick in OS_TimerChangePeriod
1 parent 7228100 commit ebf3f83

File tree

1 file changed

+2
-1
lines changed
  • bsp/allwinner/libraries/sunxi-hal/hal/source/sdmmc/osal/os/RT-Thread

1 file changed

+2
-1
lines changed

bsp/allwinner/libraries/sunxi-hal/hal/source/sdmmc/osal/os/RT-Thread/os_timer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ OS_Status OS_TimerStart(OS_Timer_t *timer)
128128
OS_Status OS_TimerChangePeriod(OS_Timer_t *timer, OS_Time_t periodMS)
129129
{
130130
rt_err_t ret;
131+
rt_tick_t periodTick = rt_tick_from_millisecond(periodMS);
131132

132133
OS_DBG("%s(), handle %p\n", __func__, timer->handle);
133134
OS_HANDLE_ASSERT(OS_TimerIsValid(timer), timer->handle);
@@ -139,7 +140,7 @@ OS_Status OS_TimerChangePeriod(OS_Timer_t *timer, OS_Time_t periodMS)
139140
return OS_FAIL;
140141
}
141142
}
142-
ret = rt_timer_control(timer->handle, RT_TIMER_CTRL_SET_TIME, &periodMS);
143+
ret = rt_timer_control(timer->handle, RT_TIMER_CTRL_SET_TIME, &periodTick);
143144
if (ret != RT_EOK) {
144145
OS_ERR("err %"OS_BASETYPE_F"\n", ret);
145146
return OS_FAIL;

0 commit comments

Comments
 (0)