Merge pull request #5244 from dhalbert/stop-pio-on-deinit
Stop StateMachine explicitly on deinit
This commit is contained in:
commit
3e9daeca8f
@ -92,8 +92,6 @@ void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencode
|
||||
false, 32, false, // in settings
|
||||
false); // Not user-interruptible.
|
||||
|
||||
common_hal_rp2pio_statemachine_run(&self->state_machine, encoder_init, MP_ARRAY_SIZE(encoder_init));
|
||||
|
||||
// We're guaranteed by the init code that some output will be available promptly
|
||||
uint8_t quiescent_state;
|
||||
common_hal_rp2pio_statemachine_readinto(&self->state_machine, &quiescent_state, 1, 1);
|
||||
|
@ -559,6 +559,8 @@ void common_hal_rp2pio_statemachine_set_frequency(rp2pio_statemachine_obj_t *sel
|
||||
}
|
||||
|
||||
void rp2pio_statemachine_deinit(rp2pio_statemachine_obj_t *self, bool leave_pins) {
|
||||
common_hal_rp2pio_statemachine_stop(self);
|
||||
|
||||
uint8_t sm = self->state_machine;
|
||||
uint8_t pio_index = pio_get_index(self->pio);
|
||||
common_hal_mcu_disable_interrupts();
|
||||
|
Loading…
Reference in New Issue
Block a user