drivers/serial/uart_pl011.c : bug fix about the function : pl011_txready().

This commit is contained in:
TakuyaMiyasita 2024-06-03 15:11:45 +09:00 committed by Xiang Xiao
parent 937bdcec78
commit 99dee09146

View File

@ -587,6 +587,15 @@ static int pl011_irq_tx_complete(FAR const struct pl011_uart_port_s *sport)
return config->uart->fr & PL011_FR_TXFE;
}
static int pl011_irq_tx_ready(const struct pl011_uart_port_s *sport)
{
const struct pl011_config *config = &sport->config;
/* check for TX FIFO not full */
return ((config->uart->fr & PL011_FR_TXFF) == 0);
}
static int pl011_irq_rx_ready(FAR const struct pl011_uart_port_s *sport)
{
FAR const struct pl011_config *config = &sport->config;
@ -621,7 +630,7 @@ static bool pl011_txready(FAR struct uart_dev_s *dev)
}
return (config->uart->imsc & PL011_IMSC_TXIM) &&
pl011_irq_tx_complete(sport);
pl011_irq_tx_ready(sport);
}
/***************************************************************************