From 1a03b9867049b27275cf041c7873e73900ba10b9 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Mon, 29 Dec 2025 18:35:06 +0100 Subject: [PATCH] avoid variabe length array --- src/uart/emsuart_esp32.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/uart/emsuart_esp32.cpp b/src/uart/emsuart_esp32.cpp index 3e1659e09..2b7bf1fd3 100644 --- a/src/uart/emsuart_esp32.cpp +++ b/src/uart/emsuart_esp32.cpp @@ -52,8 +52,7 @@ void EMSuart::uart_event_task(void * pvParameters) { uart_read_bytes(EMSUART_NUM, telegram, length, portMAX_DELAY); EMSESP::incoming_telegram(telegram, (uint8_t)(length - 1)); } else { // flush buffer up to break - uint8_t buf[length]; - uart_read_bytes(EMSUART_NUM, buf, length, portMAX_DELAY); + uart_flush_input(EMSUART_NUM); } length = 0; } else if (event.type == UART_BUFFER_FULL) {