drivers: uart: fix esp32 TX checks
This fixes both TX ready and completed uart calls to meet valid condition. Closes #41526 Closes #41624 Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
This commit is contained in:
parent
3a57a8060e
commit
40ad264a47
1 changed files with 3 additions and 3 deletions
|
@ -391,7 +391,8 @@ static void uart_esp32_irq_tx_disable(const struct device *dev)
|
|||
|
||||
static int uart_esp32_irq_tx_ready(const struct device *dev)
|
||||
{
|
||||
return (uart_hal_get_txfifo_len(&DEV_CFG(dev)->hal) > 0);
|
||||
return (uart_hal_get_txfifo_len(&DEV_CFG(dev)->hal) > 0 &&
|
||||
uart_hal_get_intr_ena_status(&DEV_CFG(dev)->hal) & UART_INTR_TXFIFO_EMPTY);
|
||||
}
|
||||
|
||||
static void uart_esp32_irq_rx_enable(const struct device *dev)
|
||||
|
@ -410,8 +411,7 @@ static void uart_esp32_irq_rx_disable(const struct device *dev)
|
|||
|
||||
static int uart_esp32_irq_tx_complete(const struct device *dev)
|
||||
{
|
||||
/* check if TX FIFO is empty */
|
||||
return (uart_hal_get_txfifo_len(&DEV_CFG(dev)->hal) == UART_LL_FIFO_DEF_LEN ? 1 : 0);
|
||||
return uart_hal_is_tx_idle(&DEV_CFG(dev)->hal);
|
||||
}
|
||||
|
||||
static int uart_esp32_irq_rx_ready(const struct device *dev)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue