serial: uart_native_tty: Polling thread fix

Addresses an issue where attempts to transmit data fail.
The identified cause of this failure is the handling of the
`rx_irq_enable` and `tx_irq_enable` flags. The `else if` handling the
`tx_irq_enable` was replaced by an `if` so both flags can be true,
and both functions can be called. This fix was tested with the
`cellular_modem` example successfully.

Signed-off-by: Fabian Kainka <kainka@cognid.de>
This commit is contained in:
Fabian Kainka 2024-03-14 15:36:32 +01:00 committed by Fabio Baltieri
parent a1893c5890
commit 24c03bfacb

View file

@ -289,9 +289,11 @@ void native_tty_uart_irq_function(void *arg1, void *arg2, void *arg3)
} else {
k_sleep(K_MSEC(1));
}
} else if (data->tx_irq_enabled) {
}
if (data->tx_irq_enabled) {
native_tty_uart_irq_handler(dev);
} else {
}
if (data->tx_irq_enabled == false && data->rx_irq_enabled == false) {
k_sleep(K_MSEC(10));
}
}