From a6ba463c4c73b0e37086ada165f3be3e77b04ceb Mon Sep 17 00:00:00 2001 From: nicoboy Date: Sun, 21 Jun 2026 16:26:49 +0200 Subject: [PATCH] Reduce UART buffer flush threshold from 512 to 64 bytes Prevents MAVLink frames from being split at the 512-byte boundary into two UDP packets. With 64B threshold + 3ms inactivity timeout, each MAVLink frame (9-280 bytes) fits in a single UDP packet. Co-Authored-By: Claude Sonnet 4.6 --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index dae6a46..4c3675e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -41,7 +41,7 @@ uint32_t bytesUdpToUart = 0; unsigned long lastStatsTime = 0; // ── Buffer UART → UDP ──────────────────────────────────── -#define UART_BUF_SIZE 512 +#define UART_BUF_SIZE 64 #define UART_FLUSH_MS 3 uint8_t uartBuf[UART_BUF_SIZE]; int uartBufLen = 0;