From a93fdc165de30994fb441d1e8f6f12dfabd159c1 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 6 Aug 2014 18:27:35 -0600 Subject: [PATCH] Use the clock_systimer() macro, do access the g_system_timer() global directly. --- sched/clock_gettime.c | 6 +++--- sched/clock_settime.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sched/clock_gettime.c b/sched/clock_gettime.c index c7beb8295e3..7f6cdba623b 100644 --- a/sched/clock_gettime.c +++ b/sched/clock_gettime.c @@ -124,7 +124,7 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp) { /* Get the time since power-on in seconds and milliseconds */ - msecs = MSEC_PER_TICK * g_system_timer; + msecs = MSEC_PER_TICK * clock_systimer(); secs = msecs / MSEC_PER_SEC; /* Return the elapsed time in seconds and nanoseconds */ @@ -169,12 +169,12 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp) #endif { /* Get the elapsed time since the time-of-day was last set. - * g_system_timer provides the number of clock times since + * clock_systimer() provides the number of clock times since * power was applied; the bias value corresponds to the time * when the time-of-day was last set. */ - msecs = MSEC_PER_TICK * (g_system_timer - g_tickbias); + msecs = MSEC_PER_TICK * (clock_systimer() - g_tickbias); sdbg("msecs = %d g_tickbias=%d\n", (int)msecs, (int)g_tickbias); diff --git a/sched/clock_settime.c b/sched/clock_settime.c index d7048b09de5..302bead2487 100644 --- a/sched/clock_settime.c +++ b/sched/clock_settime.c @@ -122,7 +122,7 @@ int clock_settime(clockid_t clock_id, FAR const struct timespec *tp) * as appropriate. */ - g_tickbias = g_system_timer; + g_tickbias = clock_systimer(); /* Setup the RTC (lo- or high-res) */