serial/uart_ns16500: poll THRE to determine when data can be written
TEMT is Transmitter Empty bit which is set only when the full FIFO is empty. It makes sense to poll for THRE (Transmitter Holding Register Empty) which is set when UART can buffer new character for transmission (there is room in FIFO). This allows using the FIFO in full. Signed-off-by: Timo Teräs <timo.teras@iki.fi>
This commit is contained in:
parent
047a229985
commit
5829965278
1 changed files with 1 additions and 1 deletions
|
@ -401,7 +401,7 @@ static unsigned char uart_ns16550_poll_out(struct device *dev,
|
||||||
unsigned char c)
|
unsigned char c)
|
||||||
{
|
{
|
||||||
/* wait for transmitter to ready to accept a character */
|
/* wait for transmitter to ready to accept a character */
|
||||||
while ((INBYTE(LSR(dev)) & LSR_TEMT) == 0)
|
while ((INBYTE(LSR(dev)) & LSR_THRE) == 0)
|
||||||
;
|
;
|
||||||
|
|
||||||
OUTBYTE(THR(dev), c);
|
OUTBYTE(THR(dev), c);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue