Question regarding ns16550
Sebastian Huber
sebastian.huber at embedded-brains.de
Thu Oct 23 08:47:37 UTC 2014
Hello Daniel,
I never notice a problem with this driver. It should only write to the FIFO in
case it is completely empty. Did you observe problems?
On 21/10/14 19:32, Daniel Gutson wrote:
> Hi,
>
> in the writing interrupt mode (ns16550_write_support_int), we have
>
> for (i = 0; i < out; ++i) {
> set( port, NS16550_TRANSMIT_BUFFER, buf [i]);
> }
>
> Shouldn't we check, before writing to the register for the iterations
> after the first one,
> whether the character entered in the FIFO? (otherwise I think the
> 'for' loop could iterate
> so fast that the device had no time to process the character)
>
> In such a case, something like
>
>
> for (i = 0; i < out; ++i) {
>
> /* Wait for transmitter holding register to be empty */
> do {
> status = get( port, NS16550_LINE_STATUS);
> } while ((status & SP_LSR_THOLD) == 0);
>
> set( port, NS16550_TRANSMIT_BUFFER, buf [i]);
> }
>
> would be better?
>
> Thanks,
>
> Daniel.
>
>
--
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber at embedded-brains.de
PGP : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
More information about the devel
mailing list