esp32/machine_uart: Uninstall the UART driver before installing it.
To allow to create the same UART a second time without error.
@@ -230,6 +230,9 @@ STATIC mp_obj_t machine_uart_make_new(const mp_obj_type_t *type, size_t n_args,
break;
}
+ // Remove any existing configuration
+ uart_driver_delete(self->uart_num);
+
// init the peripheral
// Setup
uart_param_config(self->uart_num, &uartcfg);
