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:
parent
18830991e1
commit
e54d2553f3
1 changed files with 1 additions and 1 deletions
|
@ -754,7 +754,7 @@ static int uart_sam0_irq_tx_ready(const struct device *dev)
|
||||||
{
|
{
|
||||||
SercomUsart * const regs = DEV_CFG(dev)->regs;
|
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)
|
static void uart_sam0_irq_rx_enable(const struct device *dev)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue