From 2b8a2183857e7cb953469a4f0de39bc0726dfb9d Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 22 Sep 2026 16:36:46 -0700 Subject: [PATCH] Wake the main task on UART RX This removes the delay between pressing any key and getting the REPL. --- ports/zephyr-cp/common-hal/busio/UART.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ports/zephyr-cp/common-hal/busio/UART.c b/ports/zephyr-cp/common-hal/busio/UART.c index b230cc7180e..672b6471942 100644 --- a/ports/zephyr-cp/common-hal/busio/UART.c +++ b/ports/zephyr-cp/common-hal/busio/UART.c @@ -17,6 +17,7 @@ #include "py/stream.h" #include "bindings/zephyr_kernel/__init__.h" +#include "supervisor/port.h" #include #include @@ -47,7 +48,11 @@ static void serial_cb(const struct device *dev, void *user_data) { common_hal_busio_uart_clear_rx_buffer(self); mp_sched_keyboard_interrupt(); } else if (!self->rx_paused) { - if (k_msgq_put(&self->msgq, &c, K_NO_WAIT) != 0) { + if (k_msgq_put(&self->msgq, &c, K_NO_WAIT) == 0) { + // Wake the main task so it can service the new RX data + // instead of sleeping out its full timeout. + port_wake_main_task_from_isr(); + } else { self->rx_paused = true; } }