From 62e12102fd66016329f105b828f2f8d38073fc51 Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Mon, 1 Nov 2021 08:49:41 +0100 Subject: [PATCH] Check for FSensor OFF after unloaded to FINDA we may discuss when to check for the FSensor state and why, but this approach seemed to me like the least invasive method of just checking the fsensor state and reporting an error in case it didn't switch off. --- src/logic/unload_filament.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/logic/unload_filament.cpp b/src/logic/unload_filament.cpp index 036bb71..eeefc3d 100644 --- a/src/logic/unload_filament.cpp +++ b/src/logic/unload_filament.cpp @@ -43,6 +43,11 @@ bool UnloadFilament::StepInner() { ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::off); ml::leds.SetMode(mg::globals.ActiveSlot(), ml::red, ml::blink0); mi::idler.Disengage(); + } else if (mfs::fsensor.Pressed()) { + // fsensor still pressed - that smells bad - a piece of filament may still be present in the heatsink + // and that would cause serious problems while loading another filament + state = ProgressCode::ERRDisengagingIdler; + error = ErrorCode::FSENSOR_DIDNT_SWITCH_OFF; } else { state = ProgressCode::RetractingFromFinda; retract.Reset();