浏览代码

🐛 Fix Manual Move cold extrude override (#24045)

Followup to #19606

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
ellensp 3 年前
父节点
当前提交
5005c7b64c
没有帐户链接到提交者的电子邮件

+ 2
- 0
Marlin/src/lcd/menu/menu.cpp 查看文件

@@ -28,6 +28,7 @@
28 28
 #include "../../module/planner.h"
29 29
 #include "../../module/motion.h"
30 30
 #include "../../module/printcounter.h"
31
+#include "../../module/temperature.h"
31 32
 #include "../../gcode/queue.h"
32 33
 
33 34
 #if HAS_BUZZER
@@ -171,6 +172,7 @@ bool printer_busy() {
171 172
  */
172 173
 void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, const uint8_t top/*=0*/, const uint8_t items/*=0*/) {
173 174
   if (currentScreen != screen) {
175
+    thermalManager.set_menu_cold_override(false);
174 176
 
175 177
     TERN_(IS_DWIN_MARLINUI, did_first_redraw = false);
176 178
 

+ 1
- 1
Marlin/src/lcd/menu/menu_motion.cpp 查看文件

@@ -228,7 +228,7 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int
228 228
         ui.goto_screen([]{
229 229
           MenuItem_confirm::select_screen(
230 230
             GET_TEXT(MSG_BUTTON_PROCEED), GET_TEXT(MSG_BACK),
231
-            _goto_menu_move_distance_e, nullptr,
231
+            [] { _goto_menu_move_distance_e(); thermalManager.set_menu_cold_override(true); }, nullptr,
232 232
             GET_TEXT(MSG_HOTEND_TOO_COLD), (const char *)nullptr, PSTR("!")
233 233
           );
234 234
         });

+ 6
- 0
Marlin/src/module/temperature.cpp 查看文件

@@ -487,6 +487,12 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
487 487
   #endif
488 488
 #endif
489 489
 
490
+#if BOTH(HAS_MARLINUI_MENU, PREVENT_COLD_EXTRUSION) && E_MANUAL > 0
491
+  bool Temperature::allow_cold_extrude_override = false;
492
+#else
493
+  constexpr bool Temperature::allow_cold_extrude_override;
494
+#endif
495
+
490 496
 #if ENABLED(PREVENT_COLD_EXTRUSION)
491 497
   bool Temperature::allow_cold_extrude = false;
492 498
   celsius_t Temperature::extrude_min_temp = EXTRUDE_MINTEMP;

+ 9
- 1
Marlin/src/module/temperature.h 查看文件

@@ -429,10 +429,18 @@ class Temperature {
429 429
       static uint8_t soft_pwm_controller_speed;
430 430
     #endif
431 431
 
432
+    #if BOTH(HAS_MARLINUI_MENU, PREVENT_COLD_EXTRUSION) && E_MANUAL > 0
433
+      static bool allow_cold_extrude_override;
434
+      static void set_menu_cold_override(const bool allow) { allow_cold_extrude_override = allow; }
435
+    #else
436
+      static constexpr bool allow_cold_extrude_override = false;
437
+      static void set_menu_cold_override(const bool) {}
438
+    #endif
439
+
432 440
     #if ENABLED(PREVENT_COLD_EXTRUSION)
433 441
       static bool allow_cold_extrude;
434 442
       static celsius_t extrude_min_temp;
435
-      static bool tooCold(const celsius_t temp) { return allow_cold_extrude ? false : temp < extrude_min_temp - (TEMP_WINDOW); }
443
+      static bool tooCold(const celsius_t temp) { return !allow_cold_extrude && !allow_cold_extrude_override && temp < extrude_min_temp - (TEMP_WINDOW); }
436 444
       static bool tooColdToExtrude(const uint8_t E_NAME)       { return tooCold(wholeDegHotend(HOTEND_INDEX)); }
437 445
       static bool targetTooColdToExtrude(const uint8_t E_NAME) { return tooCold(degTargetHotend(HOTEND_INDEX)); }
438 446
     #else

正在加载...
取消
保存