Skip to content

Commit fd9983b

Browse files
ellenspthinkyhead
authored and
Omkar Dhekne
committed
🐛 Fix Manual Move cold extrude override (MarlinFirmware#24045)
Followup to MarlinFirmware#19606 Co-authored-by: Scott Lahteine <[email protected]>
1 parent 6348dae commit fd9983b

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
@@ -219,7 +219,7 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int
219219
ui.goto_screen([]{
220220
MenuItem_confirm::select_screen(
221221
GET_TEXT(MSG_BUTTON_PROCEED), GET_TEXT(MSG_BACK),
222-
_goto_menu_move_distance_e, nullptr,
222+
[] { _goto_menu_move_distance_e(); thermalManager.set_menu_cold_override(true); }, nullptr,
223223
GET_TEXT(MSG_HOTEND_TOO_COLD), (const char *)nullptr, PSTR("!")
224224
);
225225
});

Marlin/src/module/temperature.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,12 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
482482
#endif
483483
#endif
484484

485+
#if BOTH(HAS_MARLINUI_MENU, PREVENT_COLD_EXTRUSION) && E_MANUAL > 0
486+
bool Temperature::allow_cold_extrude_override = false;
487+
#else
488+
constexpr bool Temperature::allow_cold_extrude_override;
489+
#endif
490+
485491
#if ENABLED(PREVENT_COLD_EXTRUSION)
486492
bool Temperature::allow_cold_extrude = false;
487493
celsius_t Temperature::extrude_min_temp = EXTRUDE_MINTEMP;

Marlin/src/module/temperature.h

+9-1
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,18 @@ class Temperature {
402402
static uint8_t soft_pwm_controller_speed;
403403
#endif
404404

405+
#if BOTH(HAS_MARLINUI_MENU, PREVENT_COLD_EXTRUSION) && E_MANUAL > 0
406+
static bool allow_cold_extrude_override;
407+
static void set_menu_cold_override(const bool allow) { allow_cold_extrude_override = allow; }
408+
#else
409+
static constexpr bool allow_cold_extrude_override = false;
410+
static void set_menu_cold_override(const bool) {}
411+
#endif
412+
405413
#if ENABLED(PREVENT_COLD_EXTRUSION)
406414
static bool allow_cold_extrude;
407415
static celsius_t extrude_min_temp;
408-
static bool tooCold(const celsius_t temp) { return allow_cold_extrude ? false : temp < extrude_min_temp - (TEMP_WINDOW); }
416+
static bool tooCold(const celsius_t temp) { return !allow_cold_extrude && !allow_cold_extrude_override && temp < extrude_min_temp - (TEMP_WINDOW); }
409417
static bool tooColdToExtrude(const uint8_t E_NAME) { return tooCold(wholeDegHotend(HOTEND_INDEX)); }
410418
static bool targetTooColdToExtrude(const uint8_t E_NAME) { return tooCold(degTargetHotend(HOTEND_INDEX)); }
411419
#else

0 commit comments

Comments
 (0)