This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
CYG_IO_GET_CONFIG_SERIAL_INPUT_FLUSH
- From: "David Marqvar (DAM)" <DAM at tt dot dk>
- To: ecos-discuss at sources dot redhat dot com
- Date: Tue, 3 Dec 2002 14:59:50 +0100
- Subject: [ECOS] CYG_IO_GET_CONFIG_SERIAL_INPUT_FLUSH
I'm building a testprogram for our ASIC.
This brings me to the edges of our hardware and therefore eCos.
I've built a little program to test hardware flow control.
This test is done using an external loopback connector and using RTS/CTS.
I continue to write to the device /dev/ser1 until it is full - meaning
in_cbuf is full and has disaserted RTS and out_cbuf is therefore full also.
Before and after the test I check the status of the buffers to see if this
looks ok.
Then I flush the buffers:
cyg_io_get_config(ser_handle, CYG_IO_GET_CONFIG_SERIAL_INPUT_FLUSH,
NULL, NULL);
cyg_io_get_config(ser_handle, CYG_IO_GET_CONFIG_SERIAL_OUTPUT_FLUSH,
NULL, NULL);
But the RTS remains disaserted... isn't it supposed to be reenabled?
Eg:
case CYG_IO_GET_CONFIG_SERIAL_INPUT_FLUSH:
// Flush any buffered input
if (in_cbuf->len == 0) break; // Nothing to do if not buffered
cyg_drv_mutex_lock(&in_cbuf->lock); // Stop any further input
processing
cyg_drv_dsr_lock();
if (in_cbuf->waiting) {
in_cbuf->abort = true;
cyg_drv_cond_signal(&in_cbuf->wait);
in_cbuf->waiting = false;
}
in_cbuf->get = in_cbuf->put = in_cbuf->nb = 0; // Flush buffered
input
cyg_drv_dsr_unlock();
cyg_drv_mutex_unlock(&in_cbuf->lock);
-->>> restart_rx();
break;
Please comment on this.
/David
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss