mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-28 01:29:07 +03:00
avoid variabe length array
This commit is contained in:
@@ -52,8 +52,7 @@ void EMSuart::uart_event_task(void * pvParameters) {
|
|||||||
uart_read_bytes(EMSUART_NUM, telegram, length, portMAX_DELAY);
|
uart_read_bytes(EMSUART_NUM, telegram, length, portMAX_DELAY);
|
||||||
EMSESP::incoming_telegram(telegram, (uint8_t)(length - 1));
|
EMSESP::incoming_telegram(telegram, (uint8_t)(length - 1));
|
||||||
} else { // flush buffer up to break
|
} else { // flush buffer up to break
|
||||||
uint8_t buf[length];
|
uart_flush_input(EMSUART_NUM);
|
||||||
uart_read_bytes(EMSUART_NUM, buf, length, portMAX_DELAY);
|
|
||||||
}
|
}
|
||||||
length = 0;
|
length = 0;
|
||||||
} else if (event.type == UART_BUFFER_FULL) {
|
} else if (event.type == UART_BUFFER_FULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user