Skip to content

Commit ce9faee

Browse files
committed
EVL: Fix sleeps
1 parent 3bbdd3c commit ce9faee

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/rtapi/uspace_xenomai_evl.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
#include <evl/clock.h>
1010
#include <evl/proxy.h>
1111

12-
#include <error.h> //ToDo: Remove
13-
1412
#include <pthread.h>
1513
#include <errno.h>
1614
#include <stdio.h>
@@ -157,8 +155,8 @@ struct XenomaiApp : RtapiApp {
157155
}
158156
else
159157
{
160-
int res = clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &task->nextstart, nullptr);
161-
if(res < 0) perror("clock_nanosleep");
158+
int res = evl_sleep_until(EVL_CLOCK_MONOTONIC, &task->nextstart);
159+
if(res < 0) perror("evl_sleep_until");
162160
}
163161
}
164162

@@ -202,7 +200,9 @@ struct XenomaiApp : RtapiApp {
202200
}
203201

204202
void do_delay(long ns) {
205-
struct timespec ts = {0, ns};
203+
struct timespec ts;
204+
evl_read_clock(EVL_CLOCK_MONOTONIC, &ts);
205+
rtapi_timespec_advance(ts, ts, ns);
206206
evl_sleep_until(EVL_CLOCK_MONOTONIC, &ts);
207207
}
208208
};

0 commit comments

Comments
 (0)