Procházet zdrojové kódy

🚸 Use M600 for disabled MMU (#21865)

Giuliano Zaro před 2 roky
rodič
revize
1dd9adbfe4
No account linked to committer's email address

+ 4
- 1
Marlin/src/MarlinCore.cpp Zobrazit soubor

@@ -784,7 +784,10 @@ void idle(bool no_stepper_sleep/*=false*/) {
784 784
   (void)check_tool_sensor_stats(active_extruder, true);
785 785
 
786 786
   // Handle filament runout sensors
787
-  TERN_(HAS_FILAMENT_SENSOR, runout.run());
787
+  #if HAS_FILAMENT_SENSOR
788
+    if (TERN1(HAS_PRUSA_MMU2, !mmu2.enabled()))
789
+      runout.run();
790
+  #endif
788 791
 
789 792
   // Run HAL idle tasks
790 793
   TERN_(HAL_IDLETASK, HAL_idletask());

+ 4
- 11
Marlin/src/feature/pause.h Zobrazit soubor

@@ -73,17 +73,10 @@ extern fil_change_settings_t fc_settings[EXTRUDERS];
73 73
 
74 74
 extern uint8_t did_pause_print;
75 75
 
76
-#if ENABLED(DUAL_X_CARRIAGE)
77
-  #define DXC_PARAMS , const int8_t DXC_ext=-1
78
-  #define DXC_ARGS   , const int8_t DXC_ext
79
-  #define DXC_PASS   , DXC_ext
80
-  #define DXC_SAY    , " dxc:", int(DXC_ext)
81
-#else
82
-  #define DXC_PARAMS
83
-  #define DXC_ARGS
84
-  #define DXC_PASS
85
-  #define DXC_SAY
86
-#endif
76
+#define DXC_PARAMS OPTARG(DUAL_X_CARRIAGE, const int8_t DXC_ext=-1)
77
+#define DXC_ARGS   OPTARG(DUAL_X_CARRIAGE, const int8_t DXC_ext)
78
+#define DXC_PASS   OPTARG(DUAL_X_CARRIAGE, DXC_ext)
79
+#define DXC_SAY    OPTARG(DUAL_X_CARRIAGE, " dxc:", int(DXC_ext))
87 80
 
88 81
 // Pause the print. If unload_length is set, do a Filament Unload
89 82
 bool pause_print(

+ 26
- 19
Marlin/src/gcode/feature/pause/M600.cpp Zobrazit soubor

@@ -34,8 +34,11 @@
34 34
   #include "../../../module/tool_change.h"
35 35
 #endif
36 36
 
37
-#if ENABLED(MMU2_MENUS)
38
-  #include "../../../lcd/menu/menu_mmu2.h"
37
+#if ENABLED(HAS_PRUSA_MMU2)
38
+  #include "../../../feature/mmu/mmu2.h"
39
+  #if ENABLED(MMU2_MENUS)
40
+    #include "../../../lcd/menu/menu_mmu2.h"
41
+  #endif
39 42
 #endif
40 43
 
41 44
 #if ENABLED(MIXING_EXTRUDER)
@@ -92,10 +95,11 @@ void GcodeSuite::M600() {
92 95
     }
93 96
   #endif
94 97
 
98
+  const bool standardM600 = TERN1(MMU2_MENUS, !mmu2.enabled());
99
+
95 100
   // Show initial "wait for start" message
96
-  #if DISABLED(MMU2_MENUS)
101
+  if (standardM600)
97 102
     ui.pause_show_message(PAUSE_MESSAGE_CHANGING, PAUSE_MODE_PAUSE_PRINT, target_extruder);
98
-  #endif
99 103
 
100 104
   #if ENABLED(HOME_BEFORE_FILAMENT_CHANGE)
101 105
     // If needed, home before parking for filament change
@@ -126,17 +130,11 @@ void GcodeSuite::M600() {
126 130
   #endif
127 131
 
128 132
   #if ENABLED(MMU2_MENUS)
129
-    // For MMU2 reset retract and load/unload values so they don't mess with MMU filament handling
130
-    constexpr float unload_length = 0.5f,
131
-                    slow_load_length = 0.0f,
132
-                    fast_load_length = 0.0f;
133
+    // For MMU2, when enabled, reset retract value so it doesn't mess with MMU filament handling
134
+    const float unload_length = standardM600 ? -ABS(parser.axisunitsval('U', E_AXIS, fc_settings[active_extruder].unload_length)) : 0.5f;
133 135
   #else
134 136
     // Unload filament
135 137
     const float unload_length = -ABS(parser.axisunitsval('U', E_AXIS, fc_settings[active_extruder].unload_length));
136
-    // Slow load filament
137
-    constexpr float slow_load_length = FILAMENT_CHANGE_SLOW_LOAD_LENGTH;
138
-    // Fast load filament
139
-    const float fast_load_length = ABS(parser.axisunitsval('L', E_AXIS, fc_settings[active_extruder].load_length));
140 138
   #endif
141 139
 
142 140
   const int beep_count = parser.intval('B', -1
@@ -146,14 +144,23 @@ void GcodeSuite::M600() {
146 144
   );
147 145
 
148 146
   if (pause_print(retract, park_point, true, unload_length DXC_PASS)) {
149
-    #if ENABLED(MMU2_MENUS)
150
-      mmu2_M600();
151
-      resume_print(slow_load_length, fast_load_length, 0, beep_count DXC_PASS);
152
-    #else
147
+    if (standardM600) {
153 148
       wait_for_confirmation(true, beep_count DXC_PASS);
154
-      resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH,
155
-                   beep_count, (parser.seenval('R') ? parser.value_celsius() : 0) DXC_PASS);
156
-    #endif
149
+      resume_print(
150
+        FILAMENT_CHANGE_SLOW_LOAD_LENGTH,
151
+        ABS(parser.axisunitsval('L', E_AXIS, fc_settings[active_extruder].load_length)),
152
+        ADVANCED_PAUSE_PURGE_LENGTH,
153
+        beep_count,
154
+        parser.celsiusval('R')
155
+        DXC_PASS
156
+      );
157
+    }
158
+    else {
159
+      #if ENABLED(MMU2_MENUS)
160
+        mmu2_M600();
161
+        resume_print(0, 0, 0, beep_count, 0 DXC_PASS);
162
+      #endif
163
+    }
157 164
   }
158 165
 
159 166
   #if HAS_MULTI_EXTRUDER

Loading…
Zrušit
Uložit