The RTAI function rt_task_make_periodic() takes absolute ticks as the
start_time argument, however this was being compared to ns in the RTAI
emulation layer.

This patch fixes this, and also removes '+ period' as this seems wrong
with the way xnpod_set_thread_periodic() works.

Patch is against r1717 so it won't apply directly to head, but the
same logical bug seems to exist there?
diff --git a/ksrc/skins/rtai/task.c b/ksrc/skins/rtai/task.c
index 1f4cd2c..3426aed 100644
--- a/ksrc/skins/rtai/task.c
+++ b/ksrc/skins/rtai/task.c
@@ -272,7 +272,7 @@ int rt_task_make_periodic(RT_TASK *task, RTIME start_time, RTIME period)
 		goto unlock_and_exit;
-	if (start_time + period <= xnpod_ticks2ns(xnpod_get_time()))
+	if (start_time <= xnpod_get_time())
 		start_time = XN_INFINITE;
 	err = xnpod_set_thread_periodic(&task->thread_base, start_time, period);
Xenomai-core mailing list

Reply via email to