Commit 14bc4aee authored by Alberto Escolar Piedras's avatar Alberto Escolar Piedras Committed by Carles Cufi
Browse files

drivers uart_nrfx: Break infinite loops for simulation



While waiting for the UART to be ready in ISR
mode, for simulation only, add a tiny delay per
iteration of the busy wait loops to allow
time to pass.
This Z_SPIN_DELAY is an empty macro for any
other target than simulation.

Signed-off-by: default avatarAlberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
parent 9a27906e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1502,6 +1502,7 @@ static void uarte_nrfx_poll_out(const struct device *dev, unsigned char c)
			}

			irq_unlock(key);
			Z_SPIN_DELAY(2);
		}
	} else {
		key = wait_tx_ready(dev);
@@ -1924,6 +1925,7 @@ static int uarte_nrfx_pm_action(const struct device *dev,
			       !nrf_uarte_event_check(uarte,
						      NRF_UARTE_EVENT_ERROR)) {
				/* Busy wait for event to register */
				Z_SPIN_DELAY(2);
			}
			nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXSTARTED);
			nrf_uarte_event_clear(uarte, NRF_UARTE_EVENT_RXTO);