drivers: serial: sam u(s)art: correct interpretation of RXRDY flag

The receiver ready flag of the (channel) status register
for the sam controller was not being interpreted correctly
for both the uart and usart implementation,
according to the uart api.
Tested and confirmed using the sam4sa16ca.

Signed-off-by: Jaro Van Landschoot <jaro.vanlandschoot@basalte.be>
This commit is contained in:
Jaro Van Landschoot 2024-01-15 09:23:10 +01:00 committed by Carles Cufí
parent 640a4586c0
commit a897005b98
2 changed files with 2 additions and 2 deletions

View file

@ -49,7 +49,7 @@ static int uart_sam_poll_in(const struct device *dev, unsigned char *c)
Uart * const uart = cfg->regs;
if (!(uart->UART_SR & UART_SR_RXRDY)) {
return -EBUSY;
return -1;
}
/* got a character */

View file

@ -50,7 +50,7 @@ static int usart_sam_poll_in(const struct device *dev, unsigned char *c)
Usart * const usart = config->regs;
if (!(usart->US_CSR & US_CSR_RXRDY)) {
return -EBUSY;
return -1;
}
/* got a character */