mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 13:18:50 +08:00
sched/clock/: Don't call up_timer_gettime in clock_gettime and clock_systimer to ensure the return value from them consistent with clock_systimespec
This commit is contained in:
parent
46bd8798c5
commit
f0c5c75042
2 changed files with 2 additions and 11 deletions
|
@ -93,11 +93,7 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp)
|
|||
* reset.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_SCHED_TICKLESS)
|
||||
ret = up_timer_gettime(tp);
|
||||
#else
|
||||
ret = clock_systimespec(tp);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
@ -118,13 +114,8 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp)
|
|||
|
||||
#if defined(CONFIG_CLOCK_TIMEKEEPING)
|
||||
ret = clock_timekeeping_get_wall_time(tp);
|
||||
#elif defined(CONFIG_SCHED_TICKLESS)
|
||||
ret = up_timer_gettime(&ts);
|
||||
#else
|
||||
ret = clock_systimespec(&ts);
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_CLOCK_TIMEKEEPING
|
||||
if (ret == OK)
|
||||
{
|
||||
irqstate_t flags;
|
||||
|
|
|
@ -97,7 +97,7 @@ clock_t clock_systimer(void)
|
|||
|
||||
/* Get the time from the platform specific hardware */
|
||||
|
||||
(void)up_timer_gettime(&ts);
|
||||
(void)clock_systimespec(&ts);
|
||||
|
||||
/* Convert to a 64-bit value in microseconds, then in clock tick units */
|
||||
|
||||
|
@ -110,7 +110,7 @@ clock_t clock_systimer(void)
|
|||
|
||||
/* Get the time from the platform specific hardware */
|
||||
|
||||
(void)up_timer_gettime(&ts);
|
||||
(void)clock_systimespec(&ts);
|
||||
|
||||
/* Convert to a 64- then a 32-bit value */
|
||||
|
||||
|
|
Loading…
Reference in a new issue