Skip to content

Commit f21f58c

Browse files
committed
adjust MessageOutput for changes in espressif/arduino-esp32
the "serial console" over USB would be garbled badly after switching to "platform = [email protected]". 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).
1 parent 034026f commit f21f58c

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

src/MessageOutput.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ void MessageOutputClass::register_ws_output(AsyncWebSocket* output)
2727

2828
void MessageOutputClass::serialWrite(MessageOutputClass::message_t const& m)
2929
{
30-
// on ESP32-S3, Serial.flush() blocks until a serial console is attached.
3130
// operator bool() of HWCDC returns false if the device is not attached to
3231
// a USB host. in general it makes sense to skip writing entirely if the
3332
// default serial port is not ready.
@@ -37,7 +36,6 @@ void MessageOutputClass::serialWrite(MessageOutputClass::message_t const& m)
3736
while (written < m.size()) {
3837
written += Serial.write(m.data() + written, m.size() - written);
3938
}
40-
Serial.flush();
4139
}
4240

4341
size_t MessageOutputClass::write(uint8_t c)

0 commit comments

Comments
 (0)