aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/src/chthreads.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/rt/src/chthreads.c')
-rw-r--r--os/rt/src/chthreads.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/os/rt/src/chthreads.c b/os/rt/src/chthreads.c
index 49abadb2d..84a062b86 100644
--- a/os/rt/src/chthreads.c
+++ b/os/rt/src/chthreads.c
@@ -670,7 +670,7 @@ void chThdSleepUntil(systime_t time) {
sysinterval_t interval;
chSysLock();
- interval = chTimeDiffX(time, chVTGetSystemTimeX());
+ interval = chTimeDiffX(chVTGetSystemTimeX(), time);
if (interval > (sysinterval_t)0) {
chThdSleepS(interval);
}
@@ -697,7 +697,7 @@ systime_t chThdSleepUntilWindowed(systime_t prev, systime_t next) {
chSysLock();
time = chVTGetSystemTimeX();
if (chTimeIsInRangeX(time, prev, next)) {
- chThdSleepS(chTimeDiffX(next, time));
+ chThdSleepS(chTimeDiffX(time, next));
}
chSysUnlock();