From 4b63a8c9b4c2aca87da19bab45e7bebe3368d36c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 25 Feb 2021 11:34:03 -0600 Subject: [PATCH] rp2pio: allow keyboard interrupt while waiting for tx fifo to empty (& stall) --- ports/raspberrypi/common-hal/rp2pio/StateMachine.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c index 5625a1b29c..54c5220e70 100644 --- a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c +++ b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c @@ -673,6 +673,9 @@ static bool _transfer(rp2pio_statemachine_obj_t *self, while (!pio_sm_is_tx_fifo_empty(self->pio, self->state_machine) || (self->wait_for_txstall && (self->pio->fdebug & stall_mask) == 0)) { RUN_BACKGROUND_TASKS; + if (mp_hal_is_interrupted()) { + break; + } } } return true;