Skip to content

Commit

Permalink
Merge pull request #4405 from gudnimg/mmu-response-fix
Browse files Browse the repository at this point in the history
MMU: always wait for a request's expected response
  • Loading branch information
3d-gussner authored Dec 22, 2023
2 parents 8aa344e + c384524 commit 45d70b1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Firmware/mmu2_protocol_logic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -809,14 +809,11 @@ StepStatus ProtocolLogic::Step() {
// We are ok, switching to Idle if there is no potential next request planned.
// But the trouble is we must report a finished command if the previous command has just been finished
// i.e. only try to find some planned command if we just finished the Idle cycle
bool previousCommandFinished = currentScope == Scope::Command; // @@TODO this is a nasty hack :(
if (!ActivatePlannedRequest()) { // if nothing is planned, switch to Idle
SwitchToIdle();
} else {
} else if (ExpectsResponse()) {
// if the previous cycle was Idle and now we have planned a new command -> avoid returning Finished
if (!previousCommandFinished && currentScope == Scope::Command) {
currentStatus = Processing;
}
currentStatus = Processing;
}
} break;
case CommandRejected:
Expand Down

0 comments on commit 45d70b1

Please sign in to comment.