serial: u(s)art_sam: Fixed return value of usart_sam_irq_is_pending
The function usart_sam_irq_is_pending (uart_sam_irq_is_pending) return only the masked value of US_CSR register but it doesn't respect if the IRQ is enabled or not. For proper function it must check if the IRQ is enabled for the event. Signed-off-by: Jiri Kubias <jiri.kubias@leapslabs.com>
This commit is contained in:
parent
fb3d9744cc
commit
b71b9c688c
2 changed files with 4 additions and 4 deletions
|
@ -309,8 +309,8 @@ static int uart_sam_irq_is_pending(struct device *dev)
|
|||
{
|
||||
volatile Uart * const uart = DEV_CFG(dev)->regs;
|
||||
|
||||
return ((uart->UART_SR & UART_SR_TXRDY)
|
||||
| (uart->UART_SR & UART_SR_RXRDY));
|
||||
return (uart->UART_IMR & (UART_IMR_TXRDY | UART_IMR_RXRDY)) &
|
||||
(uart->UART_SR & (UART_SR_TXRDY | UART_SR_RXRDY));
|
||||
}
|
||||
|
||||
static int uart_sam_irq_update(struct device *dev)
|
||||
|
|
|
@ -296,8 +296,8 @@ static int usart_sam_irq_is_pending(struct device *dev)
|
|||
{
|
||||
volatile Usart * const usart = DEV_CFG(dev)->regs;
|
||||
|
||||
return ((usart->US_CSR & US_CSR_TXRDY)
|
||||
| (usart->US_CSR & US_CSR_RXRDY));
|
||||
return (usart->US_IMR & (US_IMR_TXRDY | US_IMR_RXRDY)) &
|
||||
(usart->US_CSR & (US_CSR_TXRDY | US_CSR_RXRDY));
|
||||
}
|
||||
|
||||
static int usart_sam_irq_update(struct device *dev)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue