mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 01:40:14 +01:00
rp2/machine_uart: Fix dropped UART REPL bytes on soft reset.
Necessary to fix "mpremote run" over hardware UART. Bisect shows bug was introduced byd420b4e4, but looks like made more complex by01c046d2. 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>
This commit is contained in:
committed by
Damien George
parent
43b05afdf5
commit
73feaaf931
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user