[ECOS] Interrupts and Serial Ports

Andrew Lunn andrew@lunn.ch
Tue Nov 9 07:28:00 GMT 2004


On Mon, Nov 08, 2004 at 03:39:16PM -0500, Steve Knowlton wrote:
> Andrew,
> 
> Thanks for the response. I'm pretty sure I am using the full driver and 
> not the one for diagnostic output. I have the ports set up as /dev/ser0 
> and /dev/ser1 in the config
> tool. I just need to know the correct way to read data from the port.
> 
> I have set up a handle to the port using the cyg_io_lookup function and 
> configuring
> it to 9600 baud ( plus the other parameters such as stop bits etc ) and 
> set up
> for non blocking reads. I am looping through the cyg_io_read function at 
> a rapid
> rate but am still not reading anything. I know that polling is not the 
> best way to do
> this but I don't know how to set up an interrupt driven scheme since the 
> driver is
> already using the interrupt vector. Is there a way to hook onto this 
> interrupt vector
> so that I can use this interrupt to signal the arrival of data at the port?

The serial driver will be doing all the interrupt handling for you. So
just do a blocking read and you will be unblocked when the data
arrives.

        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