summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2024-10-11 13:41:48 +1100
committerDamien George <damien@micropython.org>2024-10-15 12:23:06 +1100
commit51663b9aa71e40bbb3e82bde4918f03adb35ff62 (patch)
tree8bde3d39f4ba6df88fce82a4ddf9661d2bb82cf6
parentb33f64792f6cff9a14f935ac568e82ec385bf54d (diff)
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 <damien@micropython.org>
-rw-r--r--ports/rp2/machine_uart.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ports/rp2/machine_uart.c b/ports/rp2/machine_uart.c
index 5fe6e31fd..54791cdc5 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).