mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-19 19:33:32 +08:00
[src][clock] RT_TICK_PER_SECOND为1000时tick不用进行转换
This commit is contained in:
parent
91eca8d573
commit
91fe5ec1b8
@ -205,8 +205,12 @@ rt_tick_t rt_tick_from_millisecond(rt_int32_t ms)
|
||||
}
|
||||
else
|
||||
{
|
||||
#if RT_TICK_PER_SECOND == 1000u
|
||||
tick = ms;
|
||||
#else
|
||||
tick = RT_TICK_PER_SECOND * (ms / 1000);
|
||||
tick += (RT_TICK_PER_SECOND * (ms % 1000) + 999) / 1000;
|
||||
#endif /* RT_TICK_PER_SECOND == 1000u */
|
||||
}
|
||||
|
||||
/* return the calculated tick */
|
||||
|
Loading…
x
Reference in New Issue
Block a user