Make Pulsein long-lived

This commit is contained in:
root 2022-08-28 12:00:48 -05:00 committed by Dan Halbert
parent 7a471406c3
commit ffcc7bda33

View File

@ -87,7 +87,7 @@ STATIC mp_obj_t pulseio_pulsein_make_new(const mp_obj_type_t *type, size_t n_arg
mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
const mcu_pin_obj_t *pin = validate_obj_is_free_pin(args[ARG_pin].u_obj); const mcu_pin_obj_t *pin = validate_obj_is_free_pin(args[ARG_pin].u_obj);
pulseio_pulsein_obj_t *self = m_new_obj(pulseio_pulsein_obj_t); pulseio_pulsein_obj_t *self = m_new_ll_obj(pulseio_pulsein_obj_t);
self->base.type = &pulseio_pulsein_type; self->base.type = &pulseio_pulsein_type;
common_hal_pulseio_pulsein_construct(self, pin, args[ARG_maxlen].u_int, common_hal_pulseio_pulsein_construct(self, pin, args[ARG_maxlen].u_int,