modbus: do not loop in UART IRQ handler

On some platforms, if there are multiple MODBUS interfaces,
receiving of RTU frames may fail. Replacing while loop with
just "if" fixes this problem.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This commit is contained in:
Johann Fischer 2022-02-08 13:49:37 +01:00 committed by Anas Nashif
commit da47f41e42

View file

@ -389,7 +389,7 @@ static void uart_cb_handler(const struct device *dev, void *app_data)
cfg = ctx->cfg;
while (uart_irq_update(cfg->dev) && uart_irq_is_pending(cfg->dev)) {
if (uart_irq_update(cfg->dev) && uart_irq_is_pending(cfg->dev)) {
if (uart_irq_rx_ready(cfg->dev)) {
cb_handler_rx(ctx);