Kaynağa Gözat

Prevent extra "too long/cold" errors

Scott Lahteine 5 yıl önce
ebeveyn
işleme
0f8c3ed29a
1 değiştirilmiş dosya ile 30 ekleme ve 25 silme
  1. 30
    25
      Marlin/src/module/motion.cpp

+ 30
- 25
Marlin/src/module/motion.cpp Dosyayı Görüntüle

@@ -986,32 +986,37 @@ void prepare_move_to_destination() {
986 986
 
987 987
   #if EITHER(PREVENT_COLD_EXTRUSION, PREVENT_LENGTHY_EXTRUDE)
988 988
 
989
-    if (!DEBUGGING(DRYRUN)) {
990
-      if (destination.e != current_position.e) {
991
-        #if ENABLED(PREVENT_COLD_EXTRUSION)
992
-          if (thermalManager.tooColdToExtrude(active_extruder)) {
993
-            current_position.e = destination.e; // Behave as if the move really took place, but ignore E part
994
-            SERIAL_ECHO_MSG(MSG_ERR_COLD_EXTRUDE_STOP);
995
-          }
996
-        #endif // PREVENT_COLD_EXTRUSION
997
-        #if ENABLED(PREVENT_LENGTHY_EXTRUDE)
998
-          const float e_delta = ABS(destination.e - current_position.e) * planner.e_factor[active_extruder];
999
-          if (e_delta > (EXTRUDE_MAXLENGTH)) {
1000
-            #if ENABLED(MIXING_EXTRUDER)
1001
-              bool ignore_e = false;
1002
-              float collector[MIXING_STEPPERS];
1003
-              mixer.refresh_collector(1.0, mixer.get_current_vtool(), collector);
1004
-              MIXER_STEPPER_LOOP(e)
1005
-                if (e_delta * collector[e] > (EXTRUDE_MAXLENGTH)) { ignore_e = true; break; }
1006
-            #else
1007
-              constexpr bool ignore_e = true;
1008
-            #endif
1009
-            if (ignore_e) {
1010
-              current_position.e = destination.e; // Behave as if the move really took place, but ignore E part
1011
-              SERIAL_ECHO_MSG(MSG_ERR_LONG_EXTRUDE_STOP);
989
+    if (!DEBUGGING(DRYRUN) && destination.e != current_position.e) {
990
+      bool ignore_e = false;
991
+
992
+      #if ENABLED(PREVENT_COLD_EXTRUSION)
993
+        ignore_e = thermalManager.tooColdToExtrude(active_extruder);
994
+        if (ignore_e) SERIAL_ECHO_MSG(MSG_ERR_COLD_EXTRUDE_STOP);
995
+      #endif
996
+
997
+      #if ENABLED(PREVENT_LENGTHY_EXTRUDE)
998
+        const float e_delta = ABS(destination.e - current_position.e) * planner.e_factor[active_extruder];
999
+        if (e_delta > (EXTRUDE_MAXLENGTH)) {
1000
+          #if ENABLED(MIXING_EXTRUDER)
1001
+            float collector[MIXING_STEPPERS];
1002
+            mixer.refresh_collector(1.0, mixer.get_current_vtool(), collector);
1003
+            MIXER_STEPPER_LOOP(e) {
1004
+              if (e_delta * collector[e] > (EXTRUDE_MAXLENGTH)) {
1005
+                ignore_e = true;
1006
+                SERIAL_ECHO_MSG(MSG_ERR_LONG_EXTRUDE_STOP);
1007
+                break;
1008
+              }
1012 1009
             }
1013
-          }
1014
-        #endif // PREVENT_LENGTHY_EXTRUDE
1010
+          #else
1011
+            ignore_e = true;
1012
+            SERIAL_ECHO_MSG(MSG_ERR_LONG_EXTRUDE_STOP);
1013
+          #endif
1014
+        }
1015
+      #endif
1016
+
1017
+      if (ignore_e) {
1018
+        current_position.e = destination.e;       // Behave as if the E move really took place
1019
+        planner.set_e_position_mm(destination.e); // Prevent the planner from complaining too
1015 1020
       }
1016 1021
     }
1017 1022
 

Loading…
İptal
Kaydet