From 1cfc9514d4c5f7e8bf6a38137b82d491829ff23c Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sun, 7 Dec 2025 08:52:10 -0800 Subject: [PATCH] Adjust SerialPIO flush timeouts Fixes #3256 Reduce the minimum timeout for SerialPIO::flush from 1ms to 1us. --- cores/rp2040/SerialPIO.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cores/rp2040/SerialPIO.cpp b/cores/rp2040/SerialPIO.cpp index ddd9b0a7f..7895390a8 100644 --- a/cores/rp2040/SerialPIO.cpp +++ b/cores/rp2040/SerialPIO.cpp @@ -355,10 +355,10 @@ void SerialPIO::flush() { return; } while (!pio_sm_is_tx_fifo_empty(_txPIO, _txSM)) { - delay(1); // Wait for all FIFO to be read + /* noop */ // Busy wait for all FIFO to be read } // Could have 1 byte being transmitted, so wait for bit times - delay((1000 * (_txBits + 1)) / _baud); + delayMicroseconds((1000000 * (_txBits + 3 /* start + stop + parity */)) / _baud); } size_t SerialPIO::write(uint8_t c) {