From 51663b9aa71e40bbb3e82bde4918f03adb35ff62 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 11 Oct 2024 13:41:48 +1100 Subject: [PATCH] rp2/machine_uart: Clear timeout_char when UART is first constructed. Otherwise a previous value of `timeout_char` may be left over after a soft reset. Signed-off-by: Damien George --- ports/rp2/machine_uart.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/rp2/machine_uart.c b/ports/rp2/machine_uart.c index 5fe6e31fde..54791cdc59 100644 --- a/ports/rp2/machine_uart.c +++ b/ports/rp2/machine_uart.c @@ -390,6 +390,7 @@ static void mp_machine_uart_init_helper(machine_uart_obj_t *self, size_t n_args, if (n_args > 0 || kw_args->used > 0 || self->baudrate == 0) { if (self->baudrate == 0) { self->baudrate = DEFAULT_UART_BAUDRATE; + self->timeout_char = 0; } // Make sure timeout_char is at least as long as a whole character (13 bits to be safe).