Browse Source

Partial fix for PFW-1334

When a FSENSOR error happens, the first step for the MK3S should be to stop any loading by stopping the E-motor.

From this point, the buttons should determine what the MK3S does next.
Guðni Már Gilbert 2 years ago
parent
commit
b8432e6bf2
1 changed files with 13 additions and 0 deletions
  1. 13 0
      Firmware/mmu2.cpp

+ 13 - 0
Firmware/mmu2.cpp

@@ -733,6 +733,19 @@ void MMU2::ReportError(ErrorCode ec, uint8_t res) {
     // - report only changes of states (we can miss an error message)
     // - may be some combination of MMUAvailable + UseMMU flags and decide based on their state
     // Right now the filtering of MMU_NOT_RESPONDING is done in ReportErrorHook() as it is not a problem if mmu2.cpp
+
+    // Depending on the Progress code, we may want to do some action when an error occurs
+    switch (logic.Progress())
+    {
+    case ProgressCode::FeedingToBondtech:
+    case ProgressCode::FeedingToFSensor:
+        // FSENSOR error during load. Make sure E-motor stops moving.
+        loadFilamentStarted = false;
+        break;
+    default:
+        break;
+    }
+
     ReportErrorHook((uint16_t)ec, res);
 
     if( ec != lastErrorCode ){ // deduplicate: only report changes in error codes into the log