Merge pull request #2518 from ErnestChen1/master

[src/clock.c] avoid warning
This commit is contained in:
Bernard Xiong 2019-03-27 20:37:07 +08:00 committed by GitHub
commit 437b0da91e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -113,12 +113,12 @@ rt_tick_t rt_tick_from_millisecond(rt_int32_t ms)
if (ms < 0) if (ms < 0)
{ {
tick = RT_WAITING_FOREVER; tick = (rt_tick_t)RT_WAITING_FOREVER;
} }
else else
{ {
tick = RT_TICK_PER_SECOND * (ms / 1000); tick = RT_TICK_PER_SECOND * (ms / 1000);
tick += (RT_TICK_PER_SECOND * (ms%1000) + 999) / 1000; tick += (RT_TICK_PER_SECOND * (ms % 1000) + 999) / 1000;
} }
/* return the calculated tick */ /* return the calculated tick */