drivers: serial: numicro: fix poll_in function
The poll_in function of the NuMicro UART driver was using the UART_Read function from the Nuvoton HAL, which is blocking. Replace it with a non-blocking implementation. Signed-off-by: Filip Brozovic <fbrozovic@gmail.com>
This commit is contained in:
parent
617aa8cc65
commit
c60e100ab3
1 changed files with 3 additions and 3 deletions
|
@ -27,13 +27,13 @@ struct uart_numicro_data {
|
|||
static int uart_numicro_poll_in(const struct device *dev, unsigned char *c)
|
||||
{
|
||||
const struct uart_numicro_config *config = dev->config;
|
||||
uint32_t count;
|
||||
|
||||
count = UART_Read(config->uart, c, 1);
|
||||
if (!count) {
|
||||
if ((config->uart->FIFOSTS & UART_FIFOSTS_RXEMPTY_Msk) != 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
*c = (uint8_t)config->uart->DAT;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue