Yodyium,
> I am working on a time-delay system. To do this, I have to implement a
> thread, which will periodically compute a control signal and check the
> size of data in a FIFO.
I will presume that you mean the amount of data that has been
written to a FIFO. This distinction makes the following more tractable.
> Thus, rt_create_handler() cannot be
> used in this
> case.
But rt_create_handler() could be used to create a handler that moves
data from the FIFO to your own private buffer. You could then check the
status of your private buffer from the timing routine. Since the handlers
are run at Linux priority (low), they will not pre-empt your time-delay
handling system.
> Is there any method to check how many block of data in a FIFO by
> polling ?
If you insist on doing it this way, you might have a look at the
functions in ...../rtlinux/fifos/rtl_fifo.c. In particular, rtf_isempty
could be cobbled to work for you. Something like:
int rtf_length(unsigned int minor)
{
return fifos[minor].len;
}
The only danger appears to be that rtf_isempty is listed among the
routines which should not be used except at initialization time. I think
this is a bug in the source code documentation. I really see no reason that
this should not work. Anyone else (Victor?, Michael?) see a problem with
this?
Regards,
Steve Cohen
-- [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/