diff options
author | David Crocker <dcrocker@eschertech.com> | 2020-10-26 12:51:26 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2020-10-26 12:51:26 +0300 |
commit | 4aa0d32ed3d173588e1b700ff253e1959461bf00 (patch) | |
tree | e613297abf98593d219ca5b3fe337ef8bb66cf03 /src/GCodes/GCodes4.cpp | |
parent | af1cc41faf492fedd93cf00c2159cb358108c52a (diff) |
Implemented filament-error macro files
Diffstat (limited to 'src/GCodes/GCodes4.cpp')
-rw-r--r-- | src/GCodes/GCodes4.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/GCodes/GCodes4.cpp b/src/GCodes/GCodes4.cpp index 49173055..eed3de0d 100644 --- a/src/GCodes/GCodes4.cpp +++ b/src/GCodes/GCodes4.cpp @@ -354,9 +354,28 @@ void GCodes::RunStateMachine(GCodeBuffer& gb, const StringRef& reply) noexcept gb.AdvanceState(); if (AllAxesAreHomed()) { - if (!DoFileMacro(gb, FILAMENT_CHANGE_G, false, 600)) + if (!DoFileMacro(gb, FILAMENT_CHANGE_G, false, -1)) { - DoFileMacro(gb, PAUSE_G, true, 600); + DoFileMacro(gb, PAUSE_G, true, -1); + } + } + } + break; + + case GCodeState::filamentErrorPause1: + if (LockMovementAndWaitForStandstill(gb)) + { + gb.AdvanceState(); + if (AllAxesAreHomed()) + { + String<StringLength20> macroName; + macroName.printf(FILAMENT_ERROR "%u.g", gb.MachineState().stateParameter); + if (!DoFileMacro(gb, macroName.c_str(), false, -1)) + { + if (!DoFileMacro(gb, FILAMENT_ERROR ".g", false, -1)) + { + DoFileMacro(gb, PAUSE_G, true, -1); + } } } } @@ -364,6 +383,7 @@ void GCodes::RunStateMachine(GCodeBuffer& gb, const StringRef& reply) noexcept case GCodeState::pausing2: case GCodeState::filamentChangePause2: + case GCodeState::filamentErrorPause2: if (LockMovementAndWaitForStandstill(gb)) { reply.printf((gb.GetState() == GCodeState::filamentChangePause2) ? "Printing paused for filament change at" : "Printing paused at"); |