From a204523bbb22d45e2968d1ded64d499b9777f37f Mon Sep 17 00:00:00 2001 From: Stefan Kerkmann Date: Fri, 29 Jul 2022 20:13:16 +0200 Subject: [Core] RP2040 disable PIO IRQs on serial timeout (#17839) --- platforms/chibios/drivers/vendor/RP/RP2040/serial_vendor.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'platforms/chibios/drivers/vendor/RP') diff --git a/platforms/chibios/drivers/vendor/RP/RP2040/serial_vendor.c b/platforms/chibios/drivers/vendor/RP/RP2040/serial_vendor.c index 338146dadd..764764b3f9 100644 --- a/platforms/chibios/drivers/vendor/RP/RP2040/serial_vendor.c +++ b/platforms/chibios/drivers/vendor/RP/RP2040/serial_vendor.c @@ -206,6 +206,7 @@ static inline msg_t sync_tx(sysinterval_t timeout) { pio_set_irq0_source_enabled(pio, pis_sm0_tx_fifo_not_full + tx_state_machine, true); msg = osalThreadSuspendTimeoutS(&tx_thread, timeout); if (msg < MSG_OK) { + pio_set_irq0_source_enabled(pio, pis_sm0_tx_fifo_not_full + tx_state_machine, false); break; } } @@ -265,6 +266,7 @@ static inline msg_t sync_rx(sysinterval_t timeout) { pio_set_irq0_source_enabled(pio, pis_sm0_rx_fifo_not_empty + rx_state_machine, true); msg = osalThreadSuspendTimeoutS(&rx_thread, timeout); if (msg < MSG_OK) { + pio_set_irq0_source_enabled(pio, pis_sm0_rx_fifo_not_empty + rx_state_machine, false); break; } } -- cgit v1.2.1