drivers: serial: uart_sam0: Correct check for interrupts enabled

Fixes the issue where uart_sam0_irq_tx_ready would return true if
the INTFLAG was set even though the INTSET bit for the given
interrupt was not enabled yet through uart_sam0_irq_tx_enable.

Signed-off-by: Ron Smith <rockyowl171@gmail.com>
This commit is contained in:
Ron Smith 2021-08-29 20:24:59 -04:00 committed by Carles Cufí
commit e54d2553f3

View file

@ -754,7 +754,7 @@ static int uart_sam0_irq_tx_ready(const struct device *dev)
{
SercomUsart * const regs = DEV_CFG(dev)->regs;
return regs->INTFLAG.bit.DRE != 0;
return (regs->INTFLAG.bit.DRE != 0) && (regs->INTENSET.bit.DRE != 0);
}
static void uart_sam0_irq_rx_enable(const struct device *dev)