This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: about at91 serial device drivers
- From: Gary Thomas <gthomas at redhat dot com>
- To: Marc Pignat <marc dot pignat at hevs dot ch>
- Cc: eCos Discussion <ecos-discuss at sources dot redhat dot com>
- Date: 15 Apr 2002 06:56:53 -0600
- Subject: Re: [ECOS] about at91 serial device drivers
- References: <scbae3c0.037@hevs.ch>
On Mon, 2002-04-15 at 06:29, Marc Pignat wrote:
> As said in the comments, the getc must wait.
> In the source code of the at91 serial device drivers, this function is not blocking. Is this a bug ?
>
> // Fetch a character from the device input buffer, waiting if necessary
> static unsigned char
> at91_serial_getc(serial_channel *chan)
> {
> at91_serial_info *at91_chan = (at91_serial_info *)chan->dev_priv;
> CYG_ADDRWORD base = at91_chan->base;
> cyg_uint32 c;
>
> // Read data
> HAL_READ_UINT32(base+AT91_US_RHR, c);
> return c;
> }
This is OK since this routine should not be called unless either
a) the device is operating without interrupts or
b) interrupts are in use and the interrupt service routine has
determined that data are present to be read.
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss