Skip to content

Commit

Permalink
Fixed spurious G-code hangs in standalone mode
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishamm committed Apr 14, 2023
1 parent 1ea461b commit 8efd644
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/store/machine/connector/PollConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ export default class PollConnector extends BaseConnector {
}

// Send the code to RRF
const response = await this.request("GET", "rr_gcode", { gcode: code });
const seq = this.lastSeqs.reply, response = await this.request("GET", "rr_gcode", { gcode: code });
if (!(response instanceof Object)) {
console.warn(`Received bad response for rr_gcode: ${JSON.stringify(response)}`);
throw new CodeResponseError();
Expand All @@ -777,8 +777,8 @@ export default class PollConnector extends BaseConnector {
}

// Check if a response can be expected
if (!noWait && strippedCode !== "" && strippedCode.toUpperCase().indexOf("M997") === -1 && strippedCode.toUpperCase().indexOf("M999") === -1) {
const pendingCodes = this.pendingCodes, seq = this.lastSeqs.reply;
if (!noWait && seq === this.lastSeqs.reply && strippedCode !== "" && strippedCode.toUpperCase().indexOf("M997") === -1 && strippedCode.toUpperCase().indexOf("M999") === -1) {
const pendingCodes = this.pendingCodes;
return new Promise<string>((resolve, reject) => pendingCodes.push({ seq, resolve, reject }));
}
}
Expand Down

0 comments on commit 8efd644

Please sign in to comment.