mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 04:52:02 +08:00
sched/clock: Correct calculation for the case of Tickless mode with a 32-bit timer. In that case, the calculation was returning millisecond accuracy. That is not good when the timer accuracy is < 1 msec.
This commit is contained in:
@@ -108,7 +108,7 @@ systime_t clock_systimer(void)
|
||||
|
||||
/* Convert to a 64- then a 32-bit value */
|
||||
|
||||
tmp = MSEC2TICK(1000 * (uint64_t)ts.tv_sec + (uint64_t)ts.tv_nsec / 1000000);
|
||||
tmp = USEC2TICK(1000000 * (uint64_t)ts.tv_sec + (uint64_t)ts.tv_nsec / 1000);
|
||||
return (systime_t)(tmp & 0x00000000ffffffff);
|
||||
|
||||
# endif /* CONFIG_SYSTEM_TIME64 */
|
||||
|
||||
Reference in New Issue
Block a user