diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-10-22 10:28:37 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-10-22 10:28:37 +0300 |
commit | 0a438e515f081a89a0bc2be56dc8a91079f20c99 (patch) | |
tree | 50f52ae6a35b9cc810f6a2c60997979c74294e59 | |
parent | 9ab32495ec1352fc5dd0bf8fb88c861d5bd6a632 (diff) |
M0/M1 no longer turns heaters off if stop.g/sleep.g is found
-rw-r--r-- | src/GCodes/GCodeMachineState.h | 2 | ||||
-rw-r--r-- | src/GCodes/GCodes2.cpp | 7 | ||||
-rw-r--r-- | src/GCodes/GCodes4.cpp | 3 |
3 files changed, 7 insertions, 5 deletions
diff --git a/src/GCodes/GCodeMachineState.h b/src/GCodes/GCodeMachineState.h index 9fdab54c..f45e77f3 100644 --- a/src/GCodes/GCodeMachineState.h +++ b/src/GCodes/GCodeMachineState.h @@ -74,7 +74,7 @@ enum class GCodeState : uint8_t flashing1, flashing2, - stoppingWithHeatersOff, + stopping, // These next 9 must be contiguous gridProbing1, diff --git a/src/GCodes/GCodes2.cpp b/src/GCodes/GCodes2.cpp index 8b2e552a..60196f6b 100644 --- a/src/GCodes/GCodes2.cpp +++ b/src/GCodes/GCodes2.cpp @@ -549,8 +549,11 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, const StringRef& reply) THROWS(GCodeEx // The state will be changed a few lines down, so no need to reset it to normal here } - gb.SetState(GCodeState::stoppingWithHeatersOff); - (void)DoFileMacro(gb, (code == 0) ? STOP_G : SLEEP_G, false, SystemHelperMacroCode); + gb.SetState(GCodeState::stopping); + if (!DoFileMacro(gb, (code == 0) ? STOP_G : SLEEP_G, false, SystemHelperMacroCode)) + { + reprap.GetHeat().SwitchOffAll(true); + } } } break; diff --git a/src/GCodes/GCodes4.cpp b/src/GCodes/GCodes4.cpp index d15130d9..8351be96 100644 --- a/src/GCodes/GCodes4.cpp +++ b/src/GCodes/GCodes4.cpp @@ -631,8 +631,7 @@ void GCodes::RunStateMachine(GCodeBuffer& gb, const StringRef& reply) noexcept gb.SetState(GCodeState::normal); break; - case GCodeState::stoppingWithHeatersOff: // MO or M1 after executing stop.g/sleep.g if present - reprap.GetHeat().SwitchOffAll(true); + case GCodeState::stopping: // MO or M1 after executing stop.g/sleep.g if present if (LockMovementAndWaitForStandstill(gb)) { pauseState = PauseState::notPaused; |