Merge pull request #7234 from jepler/espressif-uart-console-break

Interrupt on UART 'break'
This commit is contained in:
Dan Halbert 2022-11-19 14:46:18 -05:00 committed by GitHub
commit d4834cb7ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,8 +49,9 @@ static void uart_event_task(void *param) {
while (true) { while (true) {
if (xQueueReceive(self->event_queue, &event, portMAX_DELAY)) { if (xQueueReceive(self->event_queue, &event, portMAX_DELAY)) {
switch (event.type) { switch (event.type) {
case UART_BREAK:
case UART_PATTERN_DET: 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) { if (self->is_console) {
port_wake_main_task(); port_wake_main_task();
if (mp_interrupt_char == CHAR_CTRL_C) { if (mp_interrupt_char == CHAR_CTRL_C) {