🐛 Fix Manual Move cold extrude override (#24045)

Followup to #19606

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
ellensp
2022-04-19 15:03:42 +12:00
committed by GitHub
parent bb5dbd13a8
commit 5005c7b64c
4 changed files with 18 additions and 2 deletions

View File

@@ -429,10 +429,18 @@ class Temperature {
static uint8_t soft_pwm_controller_speed;
#endif
#if BOTH(HAS_MARLINUI_MENU, PREVENT_COLD_EXTRUSION) && E_MANUAL > 0
static bool allow_cold_extrude_override;
static void set_menu_cold_override(const bool allow) { allow_cold_extrude_override = allow; }
#else
static constexpr bool allow_cold_extrude_override = false;
static void set_menu_cold_override(const bool) {}
#endif
#if ENABLED(PREVENT_COLD_EXTRUSION)
static bool allow_cold_extrude;
static celsius_t extrude_min_temp;
static bool tooCold(const celsius_t temp) { return allow_cold_extrude ? false : temp < extrude_min_temp - (TEMP_WINDOW); }
static bool tooCold(const celsius_t temp) { return !allow_cold_extrude && !allow_cold_extrude_override && temp < extrude_min_temp - (TEMP_WINDOW); }
static bool tooColdToExtrude(const uint8_t E_NAME) { return tooCold(wholeDegHotend(HOTEND_INDEX)); }
static bool targetTooColdToExtrude(const uint8_t E_NAME) { return tooCold(degTargetHotend(HOTEND_INDEX)); }
#else