From 934c2f160b8cc7120a5b8fd45353940a363d3d51 Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Tue, 17 May 2022 07:45:38 +0200 Subject: [PATCH] Disable axis when StallGuard detected to allow the user to remove whatever is blocking the axis --- src/logic/command_base.cpp | 1 + tests/unit/logic/homing/test_homing.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/logic/command_base.cpp b/src/logic/command_base.cpp index 8b87cea..a3fe201 100644 --- a/src/logic/command_base.cpp +++ b/src/logic/command_base.cpp @@ -87,6 +87,7 @@ bool CommandBase::WaitForOneModuleErrorRecovery(ErrorCode ec, modules::motion::M error = ec; // mui::userInput.Clear(); // @@TODO state = ProgressCode::ERRWaitingForUser; // such a situation always requires user's attention -> let the printer display an error screen + mm::motion.Disable(m.Axis()); } // are we already recovering an error - that would mean we got another one diff --git a/tests/unit/logic/homing/test_homing.cpp b/tests/unit/logic/homing/test_homing.cpp index a1c696e..4bb89c4 100644 --- a/tests/unit/logic/homing/test_homing.cpp +++ b/tests/unit/logic/homing/test_homing.cpp @@ -120,12 +120,12 @@ bool SimulateFailedMoveFirstTime(logic::CommandBase &cb) { REQUIRE(cb.Error() == ErrorCode::MOVE_SELECTOR_FAILED); REQUIRE(cb.State() == ProgressCode::ERRWaitingForUser); - // REQUIRE_FALSE(mm::motion.Enabled(mm::Selector)); + REQUIRE_FALSE(mm::motion.Enabled(mm::Selector)); // do a few steps before pushing the button WhileTopState(cb, ProgressCode::ERRWaitingForUser, 5); - // REQUIRE_FALSE(mm::motion.Enabled(mm::Selector)); + REQUIRE_FALSE(mm::motion.Enabled(mm::Selector)); PressButtonAndDebounce(cb, mb::Middle);