Make rotaryio object long-lived
This commit is contained in:
parent
0b2528bc1b
commit
fc21b30762
|
@ -74,7 +74,8 @@ STATIC mp_obj_t rotaryio_incrementalencoder_make_new(const mp_obj_type_t *type,
|
|||
const mcu_pin_obj_t *pin_a = validate_obj_is_free_pin(args[ARG_pin_a].u_obj);
|
||||
const mcu_pin_obj_t *pin_b = validate_obj_is_free_pin(args[ARG_pin_b].u_obj);
|
||||
|
||||
rotaryio_incrementalencoder_obj_t *self = m_new_obj(rotaryio_incrementalencoder_obj_t);
|
||||
// Make long-lived because some implementations use a pointer to the object as interrupt-handler data.
|
||||
rotaryio_incrementalencoder_obj_t *self = m_new_ll_obj(rotaryio_incrementalencoder_obj_t);
|
||||
self->base.type = &rotaryio_incrementalencoder_type;
|
||||
|
||||
common_hal_rotaryio_incrementalencoder_construct(self, pin_a, pin_b);
|
||||
|
|
Loading…
Reference in New Issue