Hallo
Here are the extension you want to know. I'm using Linux 2.0.37 with RT 1.3.
And here are the code-fragments you want to know :
Some explanation :
- "DataBuffer" are the data, a char-array created in the "init ()" with
"vmalloc()"
- "DataBufferCount" ist an Integer for navigation in the array
- "testsize" is the block-size to tranfer per period
- "sourcesize"is the size of the complete-data in "DataBuffer"
- WriteFIFO_Task () is a function that is scheduled periodic
void WriteFIFO_Task (int t)
{
if (rtf_put (1, &DataBuffer[DataBufferCount], testsize)==-1)
{
rt_task_wait();
return;
}
if (((sourcesize*kByte)-testsize)<DataBufferCount)
{
DataBufferCount = 0;
rt_task_wait();
return;
}
rt_task_wait ();
}
-Before this sequence there are created the needed FIFO's (one for this code).
- The timing of the WriteTask is here fix, but when the module is running, this
will be changable by commandline
if (rt_task_init (&WriteTask,WriteFIFO_Task, 0,3*kByte,0)<0)
{
printk ("Zyklischer Task konnte nicht erstellt werden\n");
return -1;
}
if (rt_task_make_periodic (&WriteTask,
(rt_get_time()+(RT_TICKS_PER_SEC*5)),(RT_TICKS_PER_SEC*2))<0)
{
printk ("Zyklischer Task konnte nicht gestartet werden\n");
return -1;
}
--- [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/