Hello RTers
This is a follow-up to me previous question which I include below for
reference. When I remove the first rt_task_suspend() all timing works fine.
So what is going on? Here is my fifo handler for resuming the suspended task
when the user-space program writes num_events to the fifo:
int start_fifo_handler(unsigned int fifo)
{
rt_task_resume(&Task);
return 1;
}
Any suggestions?
Thanks,
Daniel
>From: "daniel sheltraw" <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: [rtl] oneshot mode problem?
>Date: Fri, 14 Jul 2000 12:44:42 CDT
>
>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/
>
________________________________________________________________________
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/