Skip to content

Commit aace45a

Browse files
knagymatepeter-pycom
authored andcommitted
Define uart id as int instead of mp_obj
1 parent 46d4a31 commit aace45a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

esp32/mods/machuart.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ STATIC mp_obj_t mach_uart_init_helper(mach_uart_obj_t *self, const mp_arg_val_t
456456
}
457457

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

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

478478
#if defined(GPY) || defined(FIPY)
479479
if (uart_id > MACH_UART_1) {

0 commit comments

Comments
 (0)