From 1242f5129d5e2f4a65e6286e2fec9f97cb3814d3 Mon Sep 17 00:00:00 2001 From: Yuriy Vynnychek Date: Fri, 8 Oct 2021 15:48:44 +0300 Subject: [PATCH] drivers: serial: b91: irq_tx_ready update to check TX IRQ Updated b91_irq_tx_ready API to check TX IRQ enabled. Signed-off-by: Yuriy Vynnychek --- drivers/serial/uart_b91.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/serial/uart_b91.c b/drivers/serial/uart_b91.c index 8c40d698d9e..8b10a216615 100644 --- a/drivers/serial/uart_b91.c +++ b/drivers/serial/uart_b91.c @@ -427,7 +427,8 @@ static int uart_b91_irq_tx_ready(const struct device *dev) { volatile struct uart_b91_t *uart = GET_UART(dev); - return (uart_b91_get_tx_bufcnt(uart) < UART_TX_BUF_CNT) ? 1 : 0; + return ((uart_b91_get_tx_bufcnt(uart) < UART_TX_BUF_CNT) && + ((uart->ctrl0 & UART_TX_IRQ_MASK) != 0)) ? 1 : 0; } /* API implementation: irq_tx_complete */