Commit 3904a3f
committed
fix(USBSerial): bump per-line capture buffer 128 → 512 bytes
The USBSerial class buffers each line written to USB CDC and (when set)
hands it to a lineBufferHook callback once the newline arrives. The
buffer was 128 bytes; any line longer than 125 chars got truncated by
LineBufferAppend() with ".." appended in place of the rest, with no way
for the hook consumer to recover the rest of the line.
128 B is below several common Marlin response lines:
- M115 FIRMWARE_NAME line: ~240 chars on most printers (FIRMWARE_NAME +
version + URL + PROTOCOL_VERSION + MACHINE_TYPE + EXTRUDER_COUNT +
UUID, all concatenated).
- M503 settings dumps: many lines, several over 100.
- M118 user-emitted messages: no documented length cap.
The truncated output is misleading because the user can see *part* of
the answer they wanted (e.g. the FIRMWARE_NAME prefix in M115) but the
trailing bytes — including the UUID, which support cases sometimes
need — disappear.
Bump to 512 B. The ".." truncation marker still triggers for the rare
line that's longer, so the behaviour degrades gracefully; only the
threshold moves up. Static cost is one extra 384-byte buffer (single
global USBSerial instance) — negligible vs the 196 KB total RAM on the
xBuddy STM32F427.
The truncation logic itself was already parametrised on lineBuffer.size()
in USBSerial.cpp, so no code change there.1 parent b91eeda commit 3904a3f
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
12 | 21 | | |
13 | 22 | | |
14 | 23 | | |
| |||
0 commit comments