diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index a390a46d8e..c951fc6333 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -469,8 +469,11 @@ void GCodeQueue::get_serial_commands() { const long gcode_N = strtol(npos + 1, nullptr, 10); + // The line number must be in the correct sequence. if (gcode_N != serial.last_N + 1 && !M110) { - // In case of error on a serial port, don't prevent other serial port from making progress + // A request-for-resend line was already in transit so we got two - oops! + if (WITHIN(gcode_N, serial.last_N - 1, serial.last_N)) continue; + // A corrupted line or too high, indicating a lost line gcode_line_error(F(STR_ERR_LINE_NO), p); break; } @@ -480,13 +483,11 @@ void GCodeQueue::get_serial_commands() { uint8_t checksum = 0, count = uint8_t(apos - command); while (count) checksum ^= command[--count]; if (strtol(apos + 1, nullptr, 10) != checksum) { - // In case of error on a serial port, don't prevent other serial port from making progress gcode_line_error(F(STR_ERR_CHECKSUM_MISMATCH), p); break; } } else { - // In case of error on a serial port, don't prevent other serial port from making progress gcode_line_error(F(STR_ERR_NO_CHECKSUM), p); break; }