Selaa lähdekoodia

Ensure safe temperature for M600

Scott Lahteine 7 vuotta sitten
vanhempi
commit
eb8af486d2
2 muutettua tiedostoa jossa 25 lisäystä ja 3 poistoa
  1. 22
    2
      Marlin/Marlin_main.cpp
  2. 3
    1
      Marlin/ultralcd.cpp

+ 22
- 2
Marlin/Marlin_main.cpp Näytä tiedosto

@@ -5921,6 +5921,25 @@ inline void gcode_M17() {
5921 5921
     return true;
5922 5922
   }
5923 5923
 
5924
+  static void ensure_safe_temperature() {
5925
+    bool did_show = false;
5926
+    wait_for_heatup = true;
5927
+    while (wait_for_heatup) {
5928
+      idle();
5929
+      wait_for_heatup = false;
5930
+      HOTEND_LOOP() {
5931
+        if (thermalManager.degTargetHotend(e) && abs(thermalManager.degHotend(e) - thermalManager.degTargetHotend(e)) > 3) {
5932
+          wait_for_heatup = true;
5933
+          if (!did_show) { // Show "wait for heating"
5934
+            lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT);
5935
+            did_show = true;
5936
+          }
5937
+          break;
5938
+        }
5939
+      }
5940
+    }
5941
+  }
5942
+
5924 5943
   static void wait_for_filament_reload(int8_t max_beep_count = 0) {
5925 5944
     bool nozzle_timed_out = false;
5926 5945
 
@@ -5937,8 +5956,7 @@ inline void gcode_M17() {
5937 5956
           nozzle_timed_out |= thermalManager.is_heater_idle(e);
5938 5957
 
5939 5958
       #if ENABLED(ULTIPANEL)
5940
-        if (nozzle_timed_out)
5941
-          lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE);
5959
+        if (nozzle_timed_out) ensure_safe_temperature();
5942 5960
       #endif
5943 5961
 
5944 5962
       idle(true);
@@ -9204,6 +9222,8 @@ inline void gcode_M503() {
9204 9222
    */
9205 9223
   inline void gcode_M600() {
9206 9224
 
9225
+    ensure_safe_temperature();
9226
+
9207 9227
     // Initial retract before move to filament change position
9208 9228
     const float retract = parser.seen('E') ? parser.value_axis_units(E_AXIS) : 0
9209 9229
       #if defined(PAUSE_PARK_RETRACT_LENGTH) && PAUSE_PARK_RETRACT_LENGTH > 0

+ 3
- 1
Marlin/ultralcd.cpp Näytä tiedosto

@@ -1094,6 +1094,7 @@ void kill_screen(const char* lcd_msg) {
1094 1094
   #endif
1095 1095
 
1096 1096
   #if ENABLED(ADVANCED_PAUSE_FEATURE)
1097
+
1097 1098
     void lcd_enqueue_filament_change() {
1098 1099
       if (!DEBUGGING(DRYRUN) && thermalManager.tooColdToExtrude(active_extruder)) {
1099 1100
         lcd_save_previous_screen();
@@ -1103,7 +1104,8 @@ void kill_screen(const char* lcd_msg) {
1103 1104
       lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INIT);
1104 1105
       enqueue_and_echo_commands_P(PSTR("M600 B0"));
1105 1106
     }
1106
-  #endif
1107
+
1108
+  #endif // ADVANCED_PAUSE_FEATURE
1107 1109
 
1108 1110
   /**
1109 1111
    *

Loading…
Peruuta
Tallenna