From f21f58c67d28edae2d9d1ada5f3ecf71b9006cbc Mon Sep 17 00:00:00 2001 From: Bernhard Kirchen Date: Thu, 13 Jun 2024 22:21:44 +0200 Subject: [PATCH] adjust MessageOutput for changes in espressif/arduino-esp32 the "serial console" over USB would be garbled badly after switching to "platform = espressif32@6.7.0". this did not happen to the upstream version of MessageOutput. we used Serial.flush(), which seemed to be good in the respective context. however, the changes in github.com/espressif/arduino-esp32/pull/9462 made flush() detrimental. we remove the use of flush(), as it seems not to be required (in particular, the upstream project does not use it). --- src/MessageOutput.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/MessageOutput.cpp b/src/MessageOutput.cpp index 850dbccab..d490ca48b 100644 --- a/src/MessageOutput.cpp +++ b/src/MessageOutput.cpp @@ -27,7 +27,6 @@ void MessageOutputClass::register_ws_output(AsyncWebSocket* output) void MessageOutputClass::serialWrite(MessageOutputClass::message_t const& m) { - // on ESP32-S3, Serial.flush() blocks until a serial console is attached. // operator bool() of HWCDC returns false if the device is not attached to // a USB host. in general it makes sense to skip writing entirely if the // default serial port is not ready. @@ -37,7 +36,6 @@ void MessageOutputClass::serialWrite(MessageOutputClass::message_t const& m) while (written < m.size()) { written += Serial.write(m.data() + written, m.size() - written); } - Serial.flush(); } size_t MessageOutputClass::write(uint8_t c)