Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Resend death loop on high latency connection #24972

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion .github/workflows/test-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ jobs:
- name: Install PlatformIO
run: |
pip install -U platformio
pio upgrade --dev
pio pkg update --global
- name: Run ${{ matrix.test-platform }} Tests
Expand Down
7 changes: 4 additions & 3 deletions Marlin/src/gcode/queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down