[ECOS] polled serial
Andrew Lunn
andrew.lunn@ascom.ch
Fri Jun 1 04:42:00 GMT 2001
On Fri, Jun 01, 2001 at 12:33:23PM +0100, Andy Simpkins wrote:
> Hi there,
>
> Assuming that I have understood things properly, cyg_io_read is a blocking
> function, i.e. once called it will only return when characters have been
> received from the serial port. Is there another function available to
> either return the amount of data currently held in the receive buffer
Try this
{
cyg_serial_buf_info_t bufinfo;
cyg_uint32 len;
len = sizeof(bufinfo);
cyg_io_get_config(port_handle, CYG_IO_GET_CONFIG_SERIAL_BUFFER_INFO,
&bufinfo, &len);
return bufinfo.rx_count;
}
Andrew
More information about the Ecos-discuss
mailing list