Browse Source

Fast Filament Change temperature check (#18738)

InsanityAutomation 5 years ago
parent
commit
e1191ded02
No account linked to committer's email address
1 changed files with 13 additions and 5 deletions
  1. 13
    5
      Marlin/src/feature/pause.cpp

+ 13
- 5
Marlin/src/feature/pause.cpp View File

119
  *
119
  *
120
  * Returns 'true' if heating was completed, 'false' for abort
120
  * Returns 'true' if heating was completed, 'false' for abort
121
  */
121
  */
122
-static bool ensure_safe_temperature(const PauseMode mode=PAUSE_MODE_SAME) {
122
+static bool ensure_safe_temperature(const bool wait=true, const PauseMode mode=PAUSE_MODE_SAME) {
123
 
123
 
124
   #if ENABLED(PREVENT_COLD_EXTRUSION)
124
   #if ENABLED(PREVENT_COLD_EXTRUSION)
125
     if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder)) {
125
     if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder)) {
134
     UNUSED(mode);
134
     UNUSED(mode);
135
   #endif
135
   #endif
136
 
136
 
137
-  return thermalManager.wait_for_hotend(active_extruder);
137
+  if (wait)
138
+    return thermalManager.wait_for_hotend(active_extruder);
139
+
140
+  while (ABS(thermalManager.degHotend(active_extruder) - thermalManager.degTargetHotend(active_extruder)) > TEMP_WINDOW)
141
+    idle();
142
+
143
+  return true;
138
 }
144
 }
139
 
145
 
140
 /**
146
 /**
156
 ) {
162
 ) {
157
   TERN(HAS_LCD_MENU,,UNUSED(show_lcd));
163
   TERN(HAS_LCD_MENU,,UNUSED(show_lcd));
158
 
164
 
159
-  if (!ensure_safe_temperature(mode)) {
165
+  if (!ensure_safe_temperature(false, mode)) {
160
     #if HAS_LCD_MENU
166
     #if HAS_LCD_MENU
161
       if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_STATUS, mode);
167
       if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_STATUS, mode);
162
     #endif
168
     #endif
291
     constexpr float mix_multiplier = 1.0;
297
     constexpr float mix_multiplier = 1.0;
292
   #endif
298
   #endif
293
 
299
 
294
-  if (!ensure_safe_temperature(mode)) {
300
+  if (!ensure_safe_temperature(false, mode)) {
295
     #if HAS_LCD_MENU
301
     #if HAS_LCD_MENU
296
       if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_STATUS);
302
       if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_STATUS);
297
     #endif
303
     #endif
498
       HOTEND_LOOP() thermalManager.reset_hotend_idle_timer(e);
504
       HOTEND_LOOP() thermalManager.reset_hotend_idle_timer(e);
499
 
505
 
500
       // Wait for the heaters to reach the target temperatures
506
       // Wait for the heaters to reach the target temperatures
501
-      ensure_safe_temperature();
507
+      ensure_safe_temperature(false);
502
 
508
 
503
       // Show the prompt to continue
509
       // Show the prompt to continue
504
       show_continue_prompt(is_reload);
510
       show_continue_prompt(is_reload);
587
   // Unretract
593
   // Unretract
588
   unscaled_e_move(PAUSE_PARK_RETRACT_LENGTH, feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE));
594
   unscaled_e_move(PAUSE_PARK_RETRACT_LENGTH, feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE));
589
 
595
 
596
+  ensure_safe_temperature();
597
+
590
   // Intelligent resuming
598
   // Intelligent resuming
591
   #if ENABLED(FWRETRACT)
599
   #if ENABLED(FWRETRACT)
592
     // If retracted before goto pause
600
     // If retracted before goto pause

Loading…
Cancel
Save