From 0b81a25fda38be2c04e6f6c0fb42558c2d506f8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 21 Sep 2022 15:34:48 +0200 Subject: [PATCH 1/3] Output serial console data without buffering --- src/SerialConsole.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/SerialConsole.cpp b/src/SerialConsole.cpp index b066caa08..6a27da4c5 100644 --- a/src/SerialConsole.cpp +++ b/src/SerialConsole.cpp @@ -20,6 +20,7 @@ void consolePrintf(const char *format, ...) va_start(arg, format); console->vprintf(format, arg); va_end(arg); + console->flush(); } SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port) From fc729b0cbb369bcb3e42f15eb90035f5865e5e11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 21 Sep 2022 15:36:17 +0200 Subject: [PATCH 2/3] Send PROTOBUF over serial without delay --- src/mesh/StreamAPI.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/mesh/StreamAPI.cpp b/src/mesh/StreamAPI.cpp index 742614b6e..0b959ddcb 100644 --- a/src/mesh/StreamAPI.cpp +++ b/src/mesh/StreamAPI.cpp @@ -103,10 +103,7 @@ void StreamAPI::emitTxBuffer(size_t len) auto totalLen = len + HEADER_LEN; stream->write(txBuf, totalLen); - /* for(size_t i = 0; i < totalLen; i++) { - stream->write(txBuf[i]); - // stream->flush(); - } */ + stream->flush(); } } @@ -133,4 +130,4 @@ void StreamAPI::onConnectionChanged(bool connected) // received a packet in a while powerFSM.trigger(EVENT_SERIAL_DISCONNECTED); } -} \ No newline at end of file +} From 7c5a36ce38e7e2a0a36d152887cdd0ab1384d640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 21 Sep 2022 15:46:56 +0200 Subject: [PATCH 3/3] Update SerialConsole.cpp --- src/SerialConsole.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/SerialConsole.cpp b/src/SerialConsole.cpp index 6a27da4c5..fc8613d70 100644 --- a/src/SerialConsole.cpp +++ b/src/SerialConsole.cpp @@ -20,7 +20,9 @@ void consolePrintf(const char *format, ...) va_start(arg, format); console->vprintf(format, arg); va_end(arg); +#ifdef ARCH_ESP32 console->flush(); +#endif } SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port)