[ECOS] Asyn serial io
Andrew Lunn
andrew@lunn.ch
Fri Jun 8 14:09:00 GMT 2007
On Fri, Jun 08, 2007 at 10:42:12AM +0200, Andre Bender wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Hi,
>
> the online documentation leaves me slightly puzzeled when atemting to
> figure out how to set a serial port to asynchronus mode.
>
> I know I should use the cyg_io_set_config function with
> CYG_IO_SET_CONFIG_SERIAL_READ/WRITE_BLOCKING. What I can't figure out
> wether the value 1 is blocking or non blocking. (possible values are 0
> and 1 according to the online docu)
<Obi-Wan Kenobi>
Use the source Luke.
</Obi-Wan Kenobi>
case CYG_IO_SET_CONFIG_READ_BLOCKING:
if (*len < sizeof(cyg_uint32) || 0 == in_cbuf->len) {
return -EINVAL;
}
in_cbuf->blocking = (1 == *(cyg_uint32*)xbuf) ? true : false;
break;
case CYG_IO_SET_CONFIG_WRITE_BLOCKING:
if (*len < sizeof(cyg_uint32) || 0 == out_cbuf->len) {
return -EINVAL;
}
out_cbuf->blocking = (1 == *(cyg_uint32*)xbuf) ? true : false;
break;
So a value of 1 sets ->blocking to true.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
More information about the Ecos-discuss
mailing list