Skip to content

Commit

Permalink
adjust MessageOutput for changes in espressif/arduino-esp32
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
schlimmchen committed Jun 21, 2024
1 parent 034026f commit f21f58c
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/MessageOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand Down

0 comments on commit f21f58c

Please sign in to comment.