Browse Source

M600 R<resume temperature> (#17919)

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
chestwood96 5 years ago
parent
commit
1475fd312a
No account linked to committer's email address
3 changed files with 27 additions and 13 deletions
  1. 23
    11
      Marlin/src/feature/pause.cpp
  2. 1
    1
      Marlin/src/feature/pause.h
  3. 3
    1
      Marlin/src/gcode/feature/pause/M600.cpp

+ 23
- 11
Marlin/src/feature/pause.cpp View File

84
 #endif
84
 #endif
85
 
85
 
86
 #if HAS_BUZZER
86
 #if HAS_BUZZER
87
-  static void filament_change_beep(const int8_t max_beep_count, const bool init=false) {
87
+  static void impatient_beep(const int8_t max_beep_count, const bool restart=false) {
88
 
88
 
89
     if (TERN0(HAS_LCD_MENU, pause_mode == PAUSE_MODE_PAUSE_PRINT)) return;
89
     if (TERN0(HAS_LCD_MENU, pause_mode == PAUSE_MODE_PAUSE_PRINT)) return;
90
 
90
 
91
     static millis_t next_buzz = 0;
91
     static millis_t next_buzz = 0;
92
     static int8_t runout_beep = 0;
92
     static int8_t runout_beep = 0;
93
 
93
 
94
-    if (init) next_buzz = runout_beep = 0;
94
+    if (restart) next_buzz = runout_beep = 0;
95
+
96
+    const bool always = max_beep_count < 0;
95
 
97
 
96
     const millis_t ms = millis();
98
     const millis_t ms = millis();
97
     if (ELAPSED(ms, next_buzz)) {
99
     if (ELAPSED(ms, next_buzz)) {
98
-      if (max_beep_count < 0 || runout_beep < max_beep_count + 5) { // Only beep as long as we're supposed to
99
-        next_buzz = ms + ((max_beep_count < 0 || runout_beep < max_beep_count) ? 1000 : 500);
100
+      if (always || runout_beep < max_beep_count + 5) { // Only beep as long as we're supposed to
101
+        next_buzz = ms + ((always || runout_beep < max_beep_count) ? 1000 : 500);
100
         BUZZ(50, 880 - (runout_beep & 1) * 220);
102
         BUZZ(50, 880 - (runout_beep & 1) * 220);
101
         runout_beep++;
103
         runout_beep++;
102
       }
104
       }
103
     }
105
     }
104
   }
106
   }
107
+  inline void first_impatient_beep(const int8_t max_beep_count) { impatient_beep(max_beep_count, true); }
105
 #else
108
 #else
106
-  inline void filament_change_beep(const int8_t, const bool=false) {}
109
+  inline void impatient_beep(const int8_t, const bool=false) {}
110
+  inline void first_impatient_beep(const int8_t) {}
107
 #endif
111
 #endif
108
 
112
 
109
 /**
113
 /**
165
     #endif
169
     #endif
166
     SERIAL_ECHO_MSG(_PMSG(STR_FILAMENT_CHANGE_INSERT));
170
     SERIAL_ECHO_MSG(_PMSG(STR_FILAMENT_CHANGE_INSERT));
167
 
171
 
168
-    filament_change_beep(max_beep_count, true);
172
+    first_impatient_beep(max_beep_count);
169
 
173
 
170
     KEEPALIVE_STATE(PAUSED_FOR_USER);
174
     KEEPALIVE_STATE(PAUSED_FOR_USER);
171
     #if ENABLED(HOST_PROMPT_SUPPORT)
175
     #if ENABLED(HOST_PROMPT_SUPPORT)
180
     #endif
184
     #endif
181
     TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Load Filament")));
185
     TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(PSTR("Load Filament")));
182
     while (wait_for_user) {
186
     while (wait_for_user) {
183
-      filament_change_beep(max_beep_count);
187
+      impatient_beep(max_beep_count);
184
       idle_no_sleep();
188
       idle_no_sleep();
185
     }
189
     }
186
   }
190
   }
448
 
452
 
449
   show_continue_prompt(is_reload);
453
   show_continue_prompt(is_reload);
450
 
454
 
451
-  filament_change_beep(max_beep_count, true);
455
+  first_impatient_beep(max_beep_count);
452
 
456
 
453
   // Start the heater idle timers
457
   // Start the heater idle timers
454
   const millis_t nozzle_timeout = SEC_TO_MS(PAUSE_PARK_NOZZLE_TIMEOUT);
458
   const millis_t nozzle_timeout = SEC_TO_MS(PAUSE_PARK_NOZZLE_TIMEOUT);
468
   TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_NOZZLE_PARKED)));
472
   TERN_(EXTENSIBLE_UI, ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_NOZZLE_PARKED)));
469
   wait_for_user = true;    // LCD click or M108 will clear this
473
   wait_for_user = true;    // LCD click or M108 will clear this
470
   while (wait_for_user) {
474
   while (wait_for_user) {
471
-    filament_change_beep(max_beep_count);
475
+    impatient_beep(max_beep_count);
472
 
476
 
473
     // If the nozzle has timed out...
477
     // If the nozzle has timed out...
474
     if (!nozzle_timed_out)
478
     if (!nozzle_timed_out)
508
       wait_for_user = true;
512
       wait_for_user = true;
509
       nozzle_timed_out = false;
513
       nozzle_timed_out = false;
510
 
514
 
511
-      filament_change_beep(max_beep_count, true);
515
+      first_impatient_beep(max_beep_count);
512
     }
516
     }
513
     idle_no_sleep();
517
     idle_no_sleep();
514
   }
518
   }
539
  * - Send host action for resume, if configured
543
  * - Send host action for resume, if configured
540
  * - Resume the current SD print job, if any
544
  * - Resume the current SD print job, if any
541
  */
545
  */
542
-void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_length/*=0*/, const float &purge_length/*=ADVANCED_PAUSE_PURGE_LENGTH*/, const int8_t max_beep_count/*=0*/ DXC_ARGS) {
546
+void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_length/*=0*/, const float &purge_length/*=ADVANCED_PAUSE_PURGE_LENGTH*/, const int8_t max_beep_count/*=0*/, int16_t targetTemp/*=0*/ DXC_ARGS) {
543
   /*
547
   /*
544
   SERIAL_ECHOLNPAIR(
548
   SERIAL_ECHOLNPAIR(
545
     "start of resume_print()\ndual_x_carriage_mode:", dual_x_carriage_mode,
549
     "start of resume_print()\ndual_x_carriage_mode:", dual_x_carriage_mode,
558
     thermalManager.reset_hotend_idle_timer(e);
562
     thermalManager.reset_hotend_idle_timer(e);
559
   }
563
   }
560
 
564
 
565
+  if (targetTemp > thermalManager.degTargetHotend(active_extruder))
566
+    thermalManager.setTargetHotend(targetTemp, active_extruder);
567
+
561
   if (nozzle_timed_out || thermalManager.hotEnoughToExtrude(active_extruder)) // Load the new filament
568
   if (nozzle_timed_out || thermalManager.hotEnoughToExtrude(active_extruder)) // Load the new filament
562
     load_filament(slow_load_length, fast_load_length, purge_length, max_beep_count, true, nozzle_timed_out, PAUSE_MODE_SAME DXC_PASS);
569
     load_filament(slow_load_length, fast_load_length, purge_length, max_beep_count, true, nozzle_timed_out, PAUSE_MODE_SAME DXC_PASS);
563
 
570
 
571
+  if (targetTemp > 0) {
572
+    thermalManager.setTargetHotend(targetTemp, active_extruder);
573
+    thermalManager.wait_for_hotend(active_extruder, false);
574
+  }
575
+
564
   TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_RESUME));
576
   TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_RESUME));
565
 
577
 
566
   // Retract to prevent oozing
578
   // Retract to prevent oozing

+ 1
- 1
Marlin/src/feature/pause.h View File

87
 
87
 
88
 void wait_for_confirmation(const bool is_reload=false, const int8_t max_beep_count=0 DXC_PARAMS);
88
 void wait_for_confirmation(const bool is_reload=false, const int8_t max_beep_count=0 DXC_PARAMS);
89
 
89
 
90
-void resume_print(const float &slow_load_length=0, const float &fast_load_length=0, const float &extrude_length=ADVANCED_PAUSE_PURGE_LENGTH, const int8_t max_beep_count=0 DXC_PARAMS);
90
+void resume_print(const float &slow_load_length=0, const float &fast_load_length=0, const float &extrude_length=ADVANCED_PAUSE_PURGE_LENGTH, const int8_t max_beep_count=0, int16_t targetTemp=0 DXC_PARAMS);
91
 
91
 
92
 bool load_filament(const float &slow_load_length=0, const float &fast_load_length=0, const float &extrude_length=0, const int8_t max_beep_count=0, const bool show_lcd=false,
92
 bool load_filament(const float &slow_load_length=0, const float &fast_load_length=0, const float &extrude_length=0, const int8_t max_beep_count=0, const bool show_lcd=false,
93
                           const bool pause_for_user=false, const PauseMode mode=PAUSE_MODE_PAUSE_PRINT DXC_PARAMS);
93
                           const bool pause_for_user=false, const PauseMode mode=PAUSE_MODE_PAUSE_PRINT DXC_PARAMS);

+ 3
- 1
Marlin/src/gcode/feature/pause/M600.cpp View File

56
  *  L[distance] - Extrude distance for insertion (manual reload)
56
  *  L[distance] - Extrude distance for insertion (manual reload)
57
  *  B[count]    - Number of times to beep, -1 for indefinite (if equipped with a buzzer)
57
  *  B[count]    - Number of times to beep, -1 for indefinite (if equipped with a buzzer)
58
  *  T[toolhead] - Select extruder for filament change
58
  *  T[toolhead] - Select extruder for filament change
59
+ *  R[temp]     - Resume temperature (in current units)
59
  *
60
  *
60
  *  Default values are used for omitted arguments.
61
  *  Default values are used for omitted arguments.
61
  */
62
  */
153
       resume_print(slow_load_length, fast_load_length, 0, beep_count DXC_PASS);
154
       resume_print(slow_load_length, fast_load_length, 0, beep_count DXC_PASS);
154
     #else
155
     #else
155
       wait_for_confirmation(true, beep_count DXC_PASS);
156
       wait_for_confirmation(true, beep_count DXC_PASS);
156
-      resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, beep_count DXC_PASS);
157
+      resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH,
158
+                   beep_count, (parser.seenval('R') ? parser.value_celsius() : 0) DXC_PASS);
157
     #endif
159
     #endif
158
   }
160
   }
159
 
161
 

Loading…
Cancel
Save