Re: Misnomer in comedi_data_read_delayed()

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 09 August 2002 11:33, Calin A. Culianu wrote:
> There's slight confusion in comedi_data_read_delayed() with respect to
> nanos vs micros...
>
> The prototype for comedi_data_read_delayed() is the following:
>
> int comedi_data_read_delayed( comedi_t *it, unsigned int subdev,
>                               unsigned int chan, unsigned int range,
>                               unsigned int aref, lsampl_t *data,
>                               unsigned int nano_sec);
>
>
> You'll notice that the last parameter, nano_sec, seems to imply that the
> passed-in value should be the time to delay, in nanos.
>
> However, this value is really microseconds, since internally comedi calls
> linux's udelay() function which expects a delay time in microseconds, not
> nanoseconds.
>
> Is this the case?  At any rate can I humbly suggest changing the variable
> name in the header file and any documentation describing this function to
> micro_sec or something other than nano_sec...?

The argument is supposed to be nanoseconds, mostly just because that is the 
usual unit for timing in comedi.  You won't actually get nanosecond 
resolution, of course, but the argument gets divided by 1000 in the INSN_WAIT 
section of comedi_fops.c

- -- 
Frank

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9VAxJ5vihyNWuA4URAuKnAJ9rhWGYMC8kTZIxS6ImSyBsYzX3yQCeID1N
BB2NP1ElSFwhSC5go02sYO8=
=z1Wz
-----END PGP SIGNATURE-----

Received on 2002-08-09Z17:39:02