Re: RTAI and comedi: leaving real time?

On Fri, 2007-05-25 at 01:11 +0200, Paolo Mantegazza wrote:
> Ciao,
> 
> let's reset and see if I got something better, in the sense I likely 
> understood a possible mistake of mine after asking to my dept comedi 
> experts.
> 
> So just try replacing the exsting comedi_dio_bitfield user space wrapper 
> with the following:
> 
> 
> 
> RTAI_PROTO(int, comedi_dio_bitfield,(void *dev, unsigned int subdev, 
> unsigned int mask, unsigned int *bits))
> {
>          int retval;
>          unsigned int lbits = *bits;
>          struct { void *dev; unsigned long subdev; unsigned long mask; 
> unsigned int *bits; } arg = { dev, subdev, mask, &lbits };
>          retval = rtai_lxrt(FUN_COMEDI_LXRT_INDX, COMEDI_LXRT_SIZARG, 
> _KCOMEDI_DIO_BITFIELD, &arg).i[LOW];
>          *bits = lbits;
>          return retval;
> }
> 
> Notice that the only change is the following:
> unsigned int lbits = *bits;
> 
> Reports the result please!
Hi Paolo,

Of course! I should have seen that myself. Without the assignment no
bits were ever written (or probably only zeros). That's why calling
bitfield() in my initialisation worked: it sets all bits to zero. 
I tested with this new wrapper in rtai_comedi.h and it works perfectly. 


Thanks,

Lennart.


> 
> 
> Paolo.
-- 
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
L.C. Karssen
Department of Physics and Astronomy
Faculty of Science
Utrecht University
Princetonplein 1
3584 CC  Utrecht
The Netherlands

tel.: +31 (0)30-253-2208
fax.: +31 (0)30-253-7468
e-mail: L.C.Karssen_at_phys.uu.nl
www: http://www1.phys.uu.nl/wwwaoud
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-


_______________________________________________
RTAI mailing list
RTAI_at_rtai.org
https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai

Received on 2007-05-25Z06:33:07