summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobert-hh <robert@hammelrath.com>2022-05-08 07:58:51 +0200
committerDamien George <damien@micropython.org>2022-06-07 18:21:46 +1000
commit5cc2dd4f5d708ded1ceb05d7755c004e4fec7295 (patch)
treefa9f68e16d7e3d6bf36faa204a80f860b1329d7c
parent767f2ce9a77606d438652edc5ac32d1ce4544907 (diff)
mimxrt/machine_uart: Fix an inconsistency for UART.init() arg handling.
With keyword arguments only or just a single non-keyword argument, UART.init() did not perform the settings.
-rw-r--r--ports/mimxrt/machine_uart.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ports/mimxrt/machine_uart.c b/ports/mimxrt/machine_uart.c
index 5b1f285d8..115d9226b 100644
--- a/ports/mimxrt/machine_uart.c
+++ b/ports/mimxrt/machine_uart.c
@@ -208,7 +208,7 @@ STATIC mp_obj_t machine_uart_init_helper(machine_uart_obj_t *self, size_t n_args
}
// Initialise the UART peripheral if any arguments given, or it was not initialised previously.
- if (n_args > 1 || self->new) {
+ if (n_args > 0 || kw_args->used > 0 || self->new) {
self->new = false;
// may be obsolete
if (self->config.baudRate_Bps == 0) {