Skip to content

Commit

Permalink
Add error message on exceeding cmd buffer length on gcode parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
bkerler committed Aug 30, 2024
1 parent f5a498a commit da4e62b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Marlin/Marlin/src/core/language.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
#define MSG_STATS "Stats: "
#define MSG_FILE_SAVED "Done saving file."
#define MSG_ERR_LINE_NO "Line Number is not Last Line Number+1, Last Line: "
#define MSG_ERR_LINE_LENGTH "Line exceeds max buffer length. Last Line: "
#define MSG_ERR_CHECKSUM_MISMATCH "checksum mismatch, Last Line: "
#define MSG_ERR_NO_CHECKSUM "No Checksum with line number, Last Line: "
#define MSG_FILE_PRINTED "Done printing file"
Expand Down
1 change: 1 addition & 0 deletions lib/Marlin/Marlin/src/gcode/queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ void GCodeQueue::get_serial_commands() {
else if (serial_count[i] >= MAX_CMD_SIZE - 1) {
// Keep fetching, but ignore normal characters beyond the max length
// The command will be injected when EOL is reached
gcode_line_error(PSTR(MSG_ERR_LINE_LENGTH), i);
}
else if (serial_char == '\\') { // Handle escapes
// if we have one more character, copy it over
Expand Down

0 comments on commit da4e62b

Please sign in to comment.