Hi,

I created a periodic task but the period-time changes
from time to time.
The tak decides on his own when he wants to be recalled again.
At the moment I do this in the following way:

 RTIME wait=last_send+wait_time-rt_get_time()-CAN_SEND_PERIOD;
 // should I wait longer than CAN_SEND_PERIOD ?
 if (wait>0)
 {
     long flags;
     r_save_flags(flags);
     r_cli();
     // wait a litle bit longer next time:
     can_send_task.resume_time=rt_get_time()+wait;
     r_restore_flags(flags);
 }
 rt_task_wait();

Is there a better way ?

Kay =8^)
-- 
     |\/\/\/|    
     |      |        Kay-Ulrich Scholl               |
     |      |        [EMAIL PROTECTED]                   |
     | (o)(o)       Forschungszentrum Informatik     |
     C      _)      Haid-und Neu-Str. 10-14          |
     | ,___|        D-76131 Karlsruhe                |
     |   /          0721/9654-218                    |
    /____\          FAX: 0721 / 9654 - 209           |
   /      \ -----------------------------------------+
--- [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/

Reply via email to