[Xenomai] Sensoray 626 analogy driver

Wojciech Domski wojciech.domski at gmail.com
Tue Mar 25 11:26:40 CET 2014


W dniu 24.03.2014 13:19, Gilles Chanteperdrix pisze:
> The solution which would be acceptable is not to have busy waits, except
> for very short durations. But for instance transferring a byte on I2C
> takes around 20us at 400 kHz, a 20us masking section is unacceptable.
> rtdm_task_busy_sleep, as the name suggests is a busy wait loop, so, no,
> it is not acceptable either.
>
> Use a thread or a timer to reschedule while you wait for the end of the
> transfer, instead of busy waiting.
Dear Gilles,

As you mentioned before the driver has few places like this:

while(!FLAG1);
while(!FLAG2);

Would a solution of creating a separate task for this purpose be ok?

task()
{
     while(!FLAG1);
     while(!FLAG2);
}

In the place of those loops a piece of code responsible for creating and 
joining task would be put instead:

rtdm_task_init();
rtdm_task_join_nrt();

Best regards,

Wojciech Domski

Domski.pl

Wojciech.Domski.pl





More information about the Xenomai mailing list