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:
Rajan Gill
2016-11-19 09:55:21 -06:00
committed by Gregory Nutt
parent 439c72e7c8
commit 0d8e191d69
+1 -1
View File
@@ -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 */