From 4e0f8e7fcd9cb65bd4583ece41bea6fc7277c3c4 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 19 Nov 2022 10:50:12 -0600 Subject: [PATCH] Interrupt on UART 'break' Tested and working with the CH9102F USB converter on Adafruit's Feather ESP32 V2 (& tio as the software on the host computer) Closes: #7233 --- ports/espressif/common-hal/busio/UART.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/espressif/common-hal/busio/UART.c b/ports/espressif/common-hal/busio/UART.c index cdaf25250f..f025c15b3e 100644 --- a/ports/espressif/common-hal/busio/UART.c +++ b/ports/espressif/common-hal/busio/UART.c @@ -49,8 +49,9 @@ static void uart_event_task(void *param) { while (true) { if (xQueueReceive(self->event_queue, &event, portMAX_DELAY)) { switch (event.type) { + case UART_BREAK: case UART_PATTERN_DET: - // When the console uart receives CTRL+C, wake the main task and schedule a keyboard interrupt + // When the console uart receives CTRL+C or BREAK, wake the main task and schedule a keyboard interrupt if (self->is_console) { port_wake_main_task(); if (mp_interrupt_char == CHAR_CTRL_C) {