Skip to content

Commit 14b7251

Browse files
DavePutzdhalbert
authored andcommitted
Make pulsein object long-lived
1 parent ffcc7bd commit 14b7251

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

shared-bindings/pulseio/PulseIn.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ STATIC mp_obj_t pulseio_pulsein_make_new(const mp_obj_type_t *type, size_t n_arg
8787
mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
8888
const mcu_pin_obj_t *pin = validate_obj_is_free_pin(args[ARG_pin].u_obj);
8989

90+
// Make object long-lived to avoid moving between imports
9091
pulseio_pulsein_obj_t *self = m_new_ll_obj(pulseio_pulsein_obj_t);
9192
self->base.type = &pulseio_pulsein_type;
9293

0 commit comments

Comments
 (0)