Change the order of some operations to prevent a debug assertion from firing.

This commit is contained in:
Gregory Nutt 2015-05-18 06:34:54 -06:00
parent 85ee7fc8e8
commit 16276a4793

View File

@ -111,17 +111,17 @@ int clock_settime(clockid_t clock_id, FAR const struct timespec *tp)
flags = irqsave();
/* Save the new base time. */
g_basetime.tv_sec = tp->tv_sec;
g_basetime.tv_nsec = tp->tv_nsec;
/* Get the elapsed time since power up (in milliseconds). This is a
* bias value that we need to use to correct the base time.
*/
(void)clock_systimespec(&bias);
/* Save the new base time. */
g_basetime.tv_sec = tp->tv_sec;
g_basetime.tv_nsec = tp->tv_nsec;
/* Subtract that bias from the basetime so that when the system
* timer is again added to the base time, the result is the current
* time relative to basetime.