Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2021-08-03 13:45:02 +0300
committerDavid Crocker <dcrocker@eschertech.com>2021-08-03 14:44:22 +0300
commit3e515ed0943d0f29c24c82a94dd81ceffed2256d (patch)
tree3f59a2ff39ae8b110a050980d85a611726d39ab6 /src/GCodes/GCodes2.cpp
parent9dc9bbdaad9645154d58ab859efa0d71e2e4c1f7 (diff)
Fixe pause followed by cancel in standalone mode; removed M0/1 H param
Diffstat (limited to 'src/GCodes/GCodes2.cpp')
-rw-r--r--src/GCodes/GCodes2.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/GCodes/GCodes2.cpp b/src/GCodes/GCodes2.cpp
index 6bb56c5a..e339fe3e 100644
--- a/src/GCodes/GCodes2.cpp
+++ b/src/GCodes/GCodes2.cpp
@@ -531,14 +531,18 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, const StringRef& reply) THROWS(GCodeEx
if (!wasSimulating) // don't run any macro files or turn heaters off etc. if we were simulating before we stopped the print
{
// If we are cancelling a paused print with M0 and we are homed and cancel.g exists then run it and do nothing else
- if (oldPauseState != PauseState::notPaused && code == 0 && AllAxesAreHomed() && DoFileMacro(gb, CANCEL_G, false, SystemHelperMacroCode))
+ if (oldPauseState != PauseState::notPaused && code == 0 && AllAxesAreHomed())
{
- pauseState = PauseState::cancelling;
- break;
+ gb.SetState(GCodeState::cancelling);
+ if (DoFileMacro(gb, CANCEL_G, false, SystemHelperMacroCode))
+ {
+ pauseState = PauseState::cancelling;
+ break;
+ }
+ // The state will be changed a few lines down, so no need to reset it to normal here
}
- const bool leaveHeatersOn = (gb.Seen('H') && gb.GetIValue() > 0);
- gb.SetState((leaveHeatersOn) ? GCodeState::stoppingWithHeatersOn : GCodeState::stoppingWithHeatersOff);
+ gb.SetState(GCodeState::stoppingWithHeatersOff);
(void)DoFileMacro(gb, (code == 0) ? STOP_G : SLEEP_G, false, SystemHelperMacroCode);
}
}