Hello Realtimers
I am using RTAI and am having a problem with long time intervals
in oneshot mode. My task looks like this:
RTIME start_time;
static void task_fun(int task arg)
{
rt_task_suspend(&Task);
start_time = rt_get_time();
for(event_num=0; event_num < num_events; event_num++){
rt_sleep_until(start_time + nano2count(ctrl[event_num].etime));
(*stim_event[ctrl[event_num].type]) (ctrl[event_num]);
}
rt_task_suspend(&Task);
}
ctrl is a struct that contains etime, the time I want the event to occur,
and type the type of event (points to a function). The task
is initailly suspended until a user-space write to a fifo with the quantity
num_events is made at which time the task is resumed.
When I make etime 1 sec, 2 sec ,3 sec, ... (for the different events indexed
by event_num) I get actual timing of 2 sec, 4 sec, 6 sec ...
Everything is multiplied by 2 (approximately I have not timed it
precisely).
Question: What's going on? Am I using oneshot mode incorrectly?
Thanks
Daniel
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/