Change the order of some operations to prevent a debug assertion from firing.
This commit is contained in:
parent
85ee7fc8e8
commit
16276a4793
@ -111,17 +111,17 @@ int clock_settime(clockid_t clock_id, FAR const struct timespec *tp)
|
|||||||
|
|
||||||
flags = irqsave();
|
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
|
/* Get the elapsed time since power up (in milliseconds). This is a
|
||||||
* bias value that we need to use to correct the base time.
|
* bias value that we need to use to correct the base time.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(void)clock_systimespec(&bias);
|
(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
|
/* Subtract that bias from the basetime so that when the system
|
||||||
* timer is again added to the base time, the result is the current
|
* timer is again added to the base time, the result is the current
|
||||||
* time relative to basetime.
|
* time relative to basetime.
|
||||||
|
Loading…
Reference in New Issue
Block a user