Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion lib/Arduino_Core_Buddy/cores/arduino/USBSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,16 @@ class USBSerial : public Stream {
private:
bool enabled;
bool isWriteOnly;
std::array<uint8_t, 128> lineBuffer;
// Per-line capture buffer fed by every char written to USB. Used by
// the lineBufferHook callback (e.g. WUI's /api/v1/log serial capture).
// 128 B was too small for several common Marlin lines: M115's
// FIRMWARE_NAME response is ~240 chars, full M503 settings dumps can
// exceed 200, and M118 user messages have no documented cap. Anything
// over the buffer was truncated to "..\n" in the hook output with no
// way for downstream tooling to recover the rest of the line.
// 512 B comfortably fits M115/M503/typical M118 with margin; the
// ".." truncation marker still triggers if a line happens to exceed.
std::array<uint8_t, 512> lineBuffer;
decltype(lineBuffer)::size_type lineBufferUsed;
static constexpr int32_t writeTimeoutUs = 3'000'000;

Expand Down