Skip to content

Commit 614e4f0

Browse files
ellenspthinkyhead
authored andcommitted
🐛 Fix Manual Move cold extrude override (MarlinFirmware#24045)
Followup to MarlinFirmware#19606 Co-authored-by: Scott Lahteine <[email protected]>
1 parent e870e47 commit 614e4f0

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

Marlin/src/lcd/menu/menu.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "../../module/planner.h"
2929
#include "../../module/motion.h"
3030
#include "../../module/printcounter.h"
31+
#include "../../module/temperature.h"
3132
#include "../../gcode/queue.h"
3233

3334
#if HAS_BUZZER
@@ -171,6 +172,7 @@ bool printer_busy() {
171172
*/
172173
void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, const uint8_t top/*=0*/, const uint8_t items/*=0*/) {
173174
if (currentScreen != screen) {
175+
thermalManager.set_menu_cold_override(false);
174176

175177
TERN_(IS_DWIN_MARLINUI, did_first_redraw = false);
176178

Marlin/src/lcd/menu/menu_motion.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int
228228
ui.goto_screen([]{
229229
MenuItem_confirm::select_screen(
230230
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,
232232
GET_TEXT(MSG_HOTEND_TOO_COLD), (const char *)nullptr, PSTR("!")
233233
);
234234
});

Marlin/src/module/temperature.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,12 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
487487
#endif
488488
#endif
489489

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+
490496
#if ENABLED(PREVENT_COLD_EXTRUSION)
491497
bool Temperature::allow_cold_extrude = false;
492498
celsius_t Temperature::extrude_min_temp = EXTRUDE_MINTEMP;

Marlin/src/module/temperature.h

+9-1
Original file line numberDiff line numberDiff line change
@@ -429,10 +429,18 @@ class Temperature {
429429
static uint8_t soft_pwm_controller_speed;
430430
#endif
431431

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+
432440
#if ENABLED(PREVENT_COLD_EXTRUSION)
433441
static bool allow_cold_extrude;
434442
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); }
436444
static bool tooColdToExtrude(const uint8_t E_NAME) { return tooCold(wholeDegHotend(HOTEND_INDEX)); }
437445
static bool targetTooColdToExtrude(const uint8_t E_NAME) { return tooCold(degTargetHotend(HOTEND_INDEX)); }
438446
#else

0 commit comments

Comments
 (0)