diff options
| author | Angus Gratton <angus@redyak.com.au> | 2024-09-26 10:32:04 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2024-09-26 23:43:11 +1000 |
| commit | 73feaaf931682288b9da4b241575e28a508cbcf8 (patch) | |
| tree | eeb86f2b89fd7159a48100c89b7a683f1fb6e3c9 | |
| parent | 43b05afdf51d19caadafd27562dafc4a85f0b67d (diff) | |
rp2/machine_uart: Fix dropped UART REPL bytes on soft reset.
Necessary to fix "mpremote run" over hardware UART.
Bisect shows bug was introduced by d420b4e4, but looks like made more
complex by 01c046d2. Specifically: resetting and re-initialising the REPL
UART during soft reset clears the FIFO before it's done printing the "MPY:
soft reboot" line.
Fixed by adding a UART TX flush in the deinit path.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
| -rw-r--r-- | ports/rp2/machine_uart.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ports/rp2/machine_uart.c b/ports/rp2/machine_uart.c index 689906003..955e4a847 100644 --- a/ports/rp2/machine_uart.c +++ b/ports/rp2/machine_uart.c @@ -458,6 +458,7 @@ static mp_obj_t mp_machine_uart_make_new(const mp_obj_type_t *type, size_t n_arg } static void mp_machine_uart_deinit(machine_uart_obj_t *self) { + uart_tx_wait_blocking(self->uart); // Flush TX FIFO if necessary uart_deinit(self->uart); if (self->uart_id == 0) { irq_set_enabled(UART0_IRQ, false); |
