From 221f40c7a1ad1ff2dd2bcf0fb769bc8e9773f59c Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Thu, 30 Sep 2021 18:20:02 +0200 Subject: [PATCH] Fix issue that all tool changes after first one fail to change to planned slot Update Filament Load state --- src/logic/tool_change.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/logic/tool_change.cpp b/src/logic/tool_change.cpp index 2a5db0d..744c15b 100644 --- a/src/logic/tool_change.cpp +++ b/src/logic/tool_change.cpp @@ -19,7 +19,7 @@ void ToolChange::Reset(uint8_t param) { return; } - if (param == mg::globals.ActiveSlot() && mg::globals.FilamentLoaded() == mg::FilamentLoadState::InNozzle) { + if (param == mg::globals.ActiveSlot() && (mg::globals.FilamentLoaded() >= mg::FilamentLoadState::InSelector)) { // we are already at the correct slot and the filament is loaded - nothing to do dbg_logic_P(PSTR("we are already at the correct slot and the filament is loaded - nothing to do\n")); return; @@ -51,6 +51,7 @@ bool ToolChange::StepInner() { // There is no way the UnloadFilament to finish in an error state state = ProgressCode::FeedingToFinda; error = ErrorCode::RUNNING; + mg::globals.SetActiveSlot(plannedSlot); feed.Reset(true); } break; @@ -77,7 +78,7 @@ bool ToolChange::StepInner() { ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::off); ml::leds.SetMode(mg::globals.ActiveSlot(), ml::red, ml::blink0); // signal loading error } else { - mg::globals.SetFilamentLoaded(mg::FilamentLoadState::InNozzle); + mg::globals.SetFilamentLoaded(mg::FilamentLoadState::InFSensor); state = ProgressCode::OK; error = ErrorCode::OK; }