Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Fixing crash when make_new is called with zero arguments (reopen) #401

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions esp32/mods/machuart.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ STATIC mp_obj_t mach_uart_init_helper(mach_uart_obj_t *self, const mp_arg_val_t
}

STATIC const mp_arg_t mach_uart_init_args[] = {
{ MP_QSTR_id, MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} },
{ MP_QSTR_id, MP_ARG_INT, {.u_int = MACH_UART_0} },
{ MP_QSTR_baudrate, MP_ARG_INT, {.u_int = 9600} },
{ MP_QSTR_bits, MP_ARG_INT, {.u_int = 8} },
{ MP_QSTR_parity, MP_ARG_OBJ, {.u_obj = mp_const_none} },
Expand All @@ -468,7 +468,7 @@ STATIC mp_obj_t mach_uart_make_new(const mp_obj_type_t *type, mp_uint_t n_args,
mp_arg_parse_all(n_args, all_args, &kw_args, MP_ARRAY_SIZE(args), mach_uart_init_args, args);

// work out the uart id
uint uart_id = mp_obj_get_int(args[0].u_obj);
uint uart_id = args[0].u_int;

#if defined(GPY) || defined(FIPY)
if (uart_id > MACH_UART_1) {
Expand Down