diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index e614f5a89a..2159ca4fc3 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -296,11 +296,7 @@ void checkHitEndstops() { card.sdprinting = false; card.closefile(); quickStop(); - setTargetHotend0(0); - setTargetHotend1(0); - setTargetHotend2(0); - setTargetHotend3(0); - setTargetBed(0); + disable_all_heaters(); // switch off all heaters. } #endif } diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 62a4f6c61d..944e4f828b 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -96,7 +96,12 @@ FORCE_INLINE float degBed() { return current_temperature_bed; } FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; } FORCE_INLINE float degTargetBed() { return target_temperature_bed; } -FORCE_INLINE void setTargetHotend(const float &celsius, uint8_t extruder) { target_temperature[extruder] = celsius; } +FORCE_INLINE void setTargetHotend(const float &celsius, uint8_t extruder) { + target_temperature[extruder] = celsius; + #ifdef WATCH_TEMP_PERIOD + start_watching_heater(extruder); + #endif +} FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; } FORCE_INLINE bool isHeatingHotend(uint8_t extruder) { return target_temperature[extruder] > current_temperature[extruder]; } diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 8584a963d5..0668b96102 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -515,12 +515,11 @@ static void lcd_tune_menu() { void _lcd_preheat(int endnum, const float temph, const float tempb, const int fan) { if (temph > 0) setTargetHotend(temph, endnum); - setTargetBed(tempb); + #if TEMP_SENSOR_BED != 0 + setTargetBed(tempb); + #endif fanSpeed = fan; lcd_return_to_status(); - #ifdef WATCH_TEMP_PERIOD - if (endnum >= 0) start_watching_heater(endnum); - #endif } void lcd_preheat_pla0() { _lcd_preheat(0, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); } void lcd_preheat_abs0() { _lcd_preheat(0, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); } @@ -602,11 +601,7 @@ void lcd_preheat_abs0() { _lcd_preheat(0, absPreheatHotendTemp, absPreheatHPBTem #endif // more than one temperature sensor present void lcd_cooldown() { - setTargetHotend0(0); - setTargetHotend1(0); - setTargetHotend2(0); - setTargetHotend3(0); - setTargetBed(0); + disable_all_heaters(); fanSpeed = 0; lcd_return_to_status(); }