Ensure safe temperature for M600

master
Scott Lahteine 8 years ago
parent bfe7fbe5c0
commit eb8af486d2

@ -5921,6 +5921,25 @@ inline void gcode_M17() {
return true; return true;
} }
static void ensure_safe_temperature() {
bool did_show = false;
wait_for_heatup = true;
while (wait_for_heatup) {
idle();
wait_for_heatup = false;
HOTEND_LOOP() {
if (thermalManager.degTargetHotend(e) && abs(thermalManager.degHotend(e) - thermalManager.degTargetHotend(e)) > 3) {
wait_for_heatup = true;
if (!did_show) { // Show "wait for heating"
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT);
did_show = true;
}
break;
}
}
}
}
static void wait_for_filament_reload(int8_t max_beep_count = 0) { static void wait_for_filament_reload(int8_t max_beep_count = 0) {
bool nozzle_timed_out = false; bool nozzle_timed_out = false;
@ -5937,8 +5956,7 @@ inline void gcode_M17() {
nozzle_timed_out |= thermalManager.is_heater_idle(e); nozzle_timed_out |= thermalManager.is_heater_idle(e);
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)
if (nozzle_timed_out) if (nozzle_timed_out) ensure_safe_temperature();
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE);
#endif #endif
idle(true); idle(true);
@ -9204,6 +9222,8 @@ inline void gcode_M503() {
*/ */
inline void gcode_M600() { inline void gcode_M600() {
ensure_safe_temperature();
// Initial retract before move to filament change position // Initial retract before move to filament change position
const float retract = parser.seen('E') ? parser.value_axis_units(E_AXIS) : 0 const float retract = parser.seen('E') ? parser.value_axis_units(E_AXIS) : 0
#if defined(PAUSE_PARK_RETRACT_LENGTH) && PAUSE_PARK_RETRACT_LENGTH > 0 #if defined(PAUSE_PARK_RETRACT_LENGTH) && PAUSE_PARK_RETRACT_LENGTH > 0

@ -1094,6 +1094,7 @@ void kill_screen(const char* lcd_msg) {
#endif #endif
#if ENABLED(ADVANCED_PAUSE_FEATURE) #if ENABLED(ADVANCED_PAUSE_FEATURE)
void lcd_enqueue_filament_change() { void lcd_enqueue_filament_change() {
if (!DEBUGGING(DRYRUN) && thermalManager.tooColdToExtrude(active_extruder)) { if (!DEBUGGING(DRYRUN) && thermalManager.tooColdToExtrude(active_extruder)) {
lcd_save_previous_screen(); lcd_save_previous_screen();
@ -1103,7 +1104,8 @@ void kill_screen(const char* lcd_msg) {
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INIT); lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INIT);
enqueue_and_echo_commands_P(PSTR("M600 B0")); enqueue_and_echo_commands_P(PSTR("M600 B0"));
} }
#endif
#endif // ADVANCED_PAUSE_FEATURE
/** /**
* *

Loading…
Cancel
Save