Sfoglia il codice sorgente

More advanced pause tweaks (#12356)

* Followup to LCD_TIMEOUT_TO_STATUS=0
* Make continuous purge screen fit 20x4
* Unify purge message modes
* Preserve last-set pause header mode
Scott Lahteine 6 anni fa
parent
commit
e574f01568
Nessun account collegato all'indirizzo email del committer

+ 4
- 1
Marlin/src/Marlin.cpp Vedi File

369
         disable_e_steppers();
369
         disable_e_steppers();
370
       #endif
370
       #endif
371
       #if HAS_LCD_MENU && ENABLED(AUTO_BED_LEVELING_UBL)
371
       #if HAS_LCD_MENU && ENABLED(AUTO_BED_LEVELING_UBL)
372
-        if (ubl.lcd_map_control) ubl.lcd_map_control = defer_return_to_status = false;
372
+        if (ubl.lcd_map_control) {
373
+          ubl.lcd_map_control = false;
374
+          set_defer_return_to_status(false);
375
+        }
373
       #endif
376
       #endif
374
     }
377
     }
375
   }
378
   }

+ 17
- 27
Marlin/src/feature/pause.cpp Vedi File

92
  *
92
  *
93
  * Returns 'true' if heating was completed, 'false' for abort
93
  * Returns 'true' if heating was completed, 'false' for abort
94
  */
94
  */
95
-static bool ensure_safe_temperature(const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT) {
95
+static bool ensure_safe_temperature(const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_SAME) {
96
 
96
 
97
   #if ENABLED(PREVENT_COLD_EXTRUSION)
97
   #if ENABLED(PREVENT_COLD_EXTRUSION)
98
     if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder)) {
98
     if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder)) {
134
                    const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_PAUSE_PRINT*/
134
                    const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_PAUSE_PRINT*/
135
                    DXC_ARGS
135
                    DXC_ARGS
136
 ) {
136
 ) {
137
-  #if DISABLED(ULTIPANEL)
138
-    UNUSED(show_lcd);
139
-  #endif
140
-
141
   if (!ensure_safe_temperature(mode)) {
137
   if (!ensure_safe_temperature(mode)) {
142
     #if HAS_LCD_MENU
138
     #if HAS_LCD_MENU
143
-      if (show_lcd) // Show status screen
144
-        lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
139
+      if (show_lcd) lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS, mode);
145
     #endif
140
     #endif
146
-
147
     return false;
141
     return false;
148
   }
142
   }
149
 
143
 
150
   if (pause_for_user) {
144
   if (pause_for_user) {
151
     #if HAS_LCD_MENU
145
     #if HAS_LCD_MENU
152
-      if (show_lcd) // Show "insert filament"
153
-        lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT, mode);
146
+      if (show_lcd) lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT, mode);
154
     #endif
147
     #endif
155
     SERIAL_ECHO_START();
148
     SERIAL_ECHO_START();
156
     SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_INSERT);
149
     SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_INSERT);
173
   }
166
   }
174
 
167
 
175
   #if HAS_LCD_MENU
168
   #if HAS_LCD_MENU
176
-    if (show_lcd) // Show "wait for load" message
177
-      lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_LOAD, mode);
169
+    if (show_lcd) lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_LOAD, mode);
170
+  #else
171
+    UNUSED(show_lcd);
178
   #endif
172
   #endif
179
 
173
 
180
   #if ENABLED(DUAL_X_CARRIAGE)
174
   #if ENABLED(DUAL_X_CARRIAGE)
210
   #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
204
   #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
211
 
205
 
212
     #if HAS_LCD_MENU
206
     #if HAS_LCD_MENU
213
-      if (show_lcd)
214
-        lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_CONTINUOUS_PURGE);
207
+      if (show_lcd) lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_PURGE);
215
     #endif
208
     #endif
216
 
209
 
217
     wait_for_user = true;
210
     wait_for_user = true;
225
       if (purge_length > 0) {
218
       if (purge_length > 0) {
226
         // "Wait for filament purge"
219
         // "Wait for filament purge"
227
         #if HAS_LCD_MENU
220
         #if HAS_LCD_MENU
228
-          if (show_lcd)
229
-            lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_PURGE, mode);
221
+          if (show_lcd) lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_PURGE);
230
         #endif
222
         #endif
231
 
223
 
232
         // Extrude filament to get into hotend
224
         // Extrude filament to get into hotend
238
         if (show_lcd) {
230
         if (show_lcd) {
239
           KEEPALIVE_STATE(PAUSED_FOR_USER);
231
           KEEPALIVE_STATE(PAUSED_FOR_USER);
240
           wait_for_user = false;
232
           wait_for_user = false;
241
-          lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_OPTION, mode);
233
+          lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_OPTION);
242
           while (advanced_pause_menu_response == ADVANCED_PAUSE_RESPONSE_WAIT_FOR) idle(true);
234
           while (advanced_pause_menu_response == ADVANCED_PAUSE_RESPONSE_WAIT_FOR) idle(true);
243
           KEEPALIVE_STATE(IN_HANDLER);
235
           KEEPALIVE_STATE(IN_HANDLER);
244
         }
236
         }
273
 ) {
265
 ) {
274
   if (!ensure_safe_temperature(mode)) {
266
   if (!ensure_safe_temperature(mode)) {
275
     #if HAS_LCD_MENU
267
     #if HAS_LCD_MENU
276
-      if (show_lcd) // Show status screen
277
-        lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
268
+      if (show_lcd) lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
278
     #endif
269
     #endif
279
 
270
 
280
     return false;
271
     return false;
281
   }
272
   }
282
 
273
 
283
-  #if DISABLED(ULTIPANEL)
284
-    UNUSED(show_lcd);
274
+  #if HAS_LCD_MENU
275
+    if (show_lcd) lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_UNLOAD, mode);
285
   #else
276
   #else
286
-    if (show_lcd)
287
-      lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_UNLOAD, mode);
277
+    UNUSED(show_lcd);
288
   #endif
278
   #endif
289
 
279
 
290
   // Retract filament
280
   // Retract filament
343
   #endif
333
   #endif
344
 
334
 
345
   #if HAS_LCD_MENU
335
   #if HAS_LCD_MENU
346
-    if (show_lcd) // Show initial message
347
-      lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INIT);
336
+    if (show_lcd) lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INIT, ADVANCED_PAUSE_MODE_PAUSE_PRINT);
337
+  #else
338
+    UNUSED(show_lcd);
348
   #endif
339
   #endif
349
 
340
 
350
   if (!DEBUGGING(DRYRUN) && unload_length && thermalManager.targetTooColdToExtrude(active_extruder)) {
341
   if (!DEBUGGING(DRYRUN) && unload_length && thermalManager.targetTooColdToExtrude(active_extruder)) {
549
     load_filament(slow_load_length, fast_load_length, purge_length, max_beep_count, true, nozzle_timed_out, ADVANCED_PAUSE_MODE_PAUSE_PRINT DXC_PASS);
540
     load_filament(slow_load_length, fast_load_length, purge_length, max_beep_count, true, nozzle_timed_out, ADVANCED_PAUSE_MODE_PAUSE_PRINT DXC_PASS);
550
 
541
 
551
   #if HAS_LCD_MENU
542
   #if HAS_LCD_MENU
552
-    lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_RESUME); // "Wait for print to resume"
543
+    lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_RESUME);
553
   #endif
544
   #endif
554
 
545
 
555
   // Intelligent resuming
546
   // Intelligent resuming
577
   #endif
568
   #endif
578
 
569
 
579
   #if HAS_LCD_MENU
570
   #if HAS_LCD_MENU
580
-    // Show status screen
581
     lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
571
     lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
582
   #endif
572
   #endif
583
 
573
 

+ 2
- 5
Marlin/src/feature/pause.h Vedi File

37
 #include "../libs/nozzle.h"
37
 #include "../libs/nozzle.h"
38
 
38
 
39
 enum AdvancedPauseMode : char {
39
 enum AdvancedPauseMode : char {
40
+  ADVANCED_PAUSE_MODE_SAME,
40
   ADVANCED_PAUSE_MODE_PAUSE_PRINT,
41
   ADVANCED_PAUSE_MODE_PAUSE_PRINT,
41
   ADVANCED_PAUSE_MODE_LOAD_FILAMENT,
42
   ADVANCED_PAUSE_MODE_LOAD_FILAMENT,
42
   ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT
43
   ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT
48
   ADVANCED_PAUSE_MESSAGE_UNLOAD,
49
   ADVANCED_PAUSE_MESSAGE_UNLOAD,
49
   ADVANCED_PAUSE_MESSAGE_INSERT,
50
   ADVANCED_PAUSE_MESSAGE_INSERT,
50
   ADVANCED_PAUSE_MESSAGE_LOAD,
51
   ADVANCED_PAUSE_MESSAGE_LOAD,
51
-  #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
52
-    ADVANCED_PAUSE_MESSAGE_CONTINUOUS_PURGE,
53
-  #else
54
-    ADVANCED_PAUSE_MESSAGE_PURGE,
55
-  #endif
52
+  ADVANCED_PAUSE_MESSAGE_PURGE,
56
   ADVANCED_PAUSE_MESSAGE_OPTION,
53
   ADVANCED_PAUSE_MESSAGE_OPTION,
57
   ADVANCED_PAUSE_MESSAGE_RESUME,
54
   ADVANCED_PAUSE_MESSAGE_RESUME,
58
   ADVANCED_PAUSE_MESSAGE_STATUS,
55
   ADVANCED_PAUSE_MESSAGE_STATUS,

+ 4
- 1
Marlin/src/gcode/control/M17_M18_M84.cpp Vedi File

61
     }
61
     }
62
 
62
 
63
     #if HAS_LCD_MENU && ENABLED(AUTO_BED_LEVELING_UBL)
63
     #if HAS_LCD_MENU && ENABLED(AUTO_BED_LEVELING_UBL)
64
-      if (ubl.lcd_map_control) ubl.lcd_map_control = defer_return_to_status = false;
64
+      if (ubl.lcd_map_control) {
65
+        ubl.lcd_map_control = false;
66
+        set_defer_return_to_status(false);
67
+      }
65
     #endif
68
     #endif
66
   }
69
   }
67
 }
70
 }

+ 2
- 2
Marlin/src/inc/SanityCheck.h Vedi File

1115
  * LCD_BED_LEVELING requirements
1115
  * LCD_BED_LEVELING requirements
1116
  */
1116
  */
1117
 #if ENABLED(LCD_BED_LEVELING)
1117
 #if ENABLED(LCD_BED_LEVELING)
1118
-  #if DISABLED(ULTIPANEL)
1119
-    #error "LCD_BED_LEVELING requires an LCD controller."
1118
+  #if !HAS_LCD_MENU
1119
+    #error "LCD_BED_LEVELING requires a programmable LCD controller."
1120
   #elif !(ENABLED(MESH_BED_LEVELING) || OLDSCHOOL_ABL)
1120
   #elif !(ENABLED(MESH_BED_LEVELING) || OLDSCHOOL_ABL)
1121
     #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or AUTO_BED_LEVELING."
1121
     #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or AUTO_BED_LEVELING."
1122
   #endif
1122
   #endif

+ 7
- 0
Marlin/src/lcd/language/language_en.h Vedi File

1131
     #define MSG_FILAMENT_CHANGE_PURGE_1       _UxGT("Wait for")
1131
     #define MSG_FILAMENT_CHANGE_PURGE_1       _UxGT("Wait for")
1132
     #define MSG_FILAMENT_CHANGE_PURGE_2       _UxGT("filament purge")
1132
     #define MSG_FILAMENT_CHANGE_PURGE_2       _UxGT("filament purge")
1133
   #endif
1133
   #endif
1134
+  #ifndef MSG_FILAMENT_CHANGE_CONT_PURGE_1
1135
+    #define MSG_FILAMENT_CHANGE_CONT_PURGE_1  _UxGT("Click to finish")
1136
+    #define MSG_FILAMENT_CHANGE_CONT_PURGE_2  _UxGT("filament purge")
1137
+  #endif
1134
   #ifndef MSG_FILAMENT_CHANGE_RESUME_1
1138
   #ifndef MSG_FILAMENT_CHANGE_RESUME_1
1135
     #define MSG_FILAMENT_CHANGE_RESUME_1      _UxGT("Wait for print")
1139
     #define MSG_FILAMENT_CHANGE_RESUME_1      _UxGT("Wait for print")
1136
     #define MSG_FILAMENT_CHANGE_RESUME_2      _UxGT("to resume...")
1140
     #define MSG_FILAMENT_CHANGE_RESUME_2      _UxGT("to resume...")
1160
   #ifndef MSG_FILAMENT_CHANGE_PURGE_1
1164
   #ifndef MSG_FILAMENT_CHANGE_PURGE_1
1161
     #define MSG_FILAMENT_CHANGE_PURGE_1       _UxGT("Purging...")
1165
     #define MSG_FILAMENT_CHANGE_PURGE_1       _UxGT("Purging...")
1162
   #endif
1166
   #endif
1167
+  #ifndef MSG_FILAMENT_CHANGE_CONT_PURGE_1
1168
+    #define MSG_FILAMENT_CHANGE_CONT_PURGE_1  _UxGT("Click to finish")
1169
+  #endif
1163
   #ifndef MSG_FILAMENT_CHANGE_RESUME_1
1170
   #ifndef MSG_FILAMENT_CHANGE_RESUME_1
1164
     #define MSG_FILAMENT_CHANGE_RESUME_1      _UxGT("Resuming...")
1171
     #define MSG_FILAMENT_CHANGE_RESUME_1      _UxGT("Resuming...")
1165
   #endif
1172
   #endif

+ 13
- 7
Marlin/src/lcd/menu/menu.cpp Vedi File

59
 } menuPosition;
59
 } menuPosition;
60
 menuPosition screen_history[6];
60
 menuPosition screen_history[6];
61
 uint8_t screen_history_depth = 0;
61
 uint8_t screen_history_depth = 0;
62
-bool screen_changed, defer_return_to_status;
62
+bool screen_changed;
63
+
64
+#if LCD_TIMEOUT_TO_STATUS
65
+  bool defer_return_to_status;
66
+#endif
63
 
67
 
64
 // Value Editing
68
 // Value Editing
65
 PGM_P editLabel;
69
 PGM_P editLabel;
97
     lcd_return_to_status();
101
     lcd_return_to_status();
98
 }
102
 }
99
 
103
 
100
-void lcd_goto_previous_menu_no_defer() {
101
-  defer_return_to_status = false;
102
-  lcd_goto_previous_menu();
103
-}
104
+#if LCD_TIMEOUT_TO_STATUS
105
+  void lcd_goto_previous_menu_no_defer() {
106
+    set_defer_return_to_status(false);
107
+    lcd_goto_previous_menu();
108
+  }
109
+#endif
104
 
110
 
105
 ////////////////////////////////////////////
111
 ////////////////////////////////////////////
106
 /////////// Common Menu Actions ////////////
112
 /////////// Common Menu Actions ////////////
234
     currentScreen = screen;
240
     currentScreen = screen;
235
     encoderPosition = encoder;
241
     encoderPosition = encoder;
236
     if (screen == lcd_status_screen) {
242
     if (screen == lcd_status_screen) {
237
-      defer_return_to_status = false;
243
+      set_defer_return_to_status(false);
238
       #if ENABLED(AUTO_BED_LEVELING_UBL)
244
       #if ENABLED(AUTO_BED_LEVELING_UBL)
239
         ubl.lcd_map_control = false;
245
         ubl.lcd_map_control = false;
240
       #endif
246
       #endif
343
 
349
 
344
   void lcd_babystep_zoffset() {
350
   void lcd_babystep_zoffset() {
345
     if (use_click()) { return lcd_goto_previous_menu_no_defer(); }
351
     if (use_click()) { return lcd_goto_previous_menu_no_defer(); }
346
-    defer_return_to_status = true;
352
+    set_defer_return_to_status(true);
347
     #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
353
     #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
348
       const bool do_probe = (active_extruder == 0);
354
       const bool do_probe = (active_extruder == 0);
349
     #else
355
     #else

+ 6
- 2
Marlin/src/lcd/menu/menu.h Vedi File

35
 bool use_click();
35
 bool use_click();
36
 bool printer_busy();
36
 bool printer_busy();
37
 void lcd_completion_feedback(const bool good=true);
37
 void lcd_completion_feedback(const bool good=true);
38
-void lcd_goto_previous_menu();
39
-void lcd_goto_previous_menu_no_defer();
40
 void lcd_save_previous_screen();
38
 void lcd_save_previous_screen();
39
+void lcd_goto_previous_menu();
40
+#if LCD_TIMEOUT_TO_STATUS
41
+  void lcd_goto_previous_menu_no_defer();
42
+#else
43
+  #define lcd_goto_previous_menu_no_defer() lcd_goto_previous_menu()
44
+#endif
41
 
45
 
42
 ////////////////////////////////////////////
46
 ////////////////////////////////////////////
43
 ////////// Menu Item Numeric Types /////////
47
 ////////// Menu Item Numeric Types /////////

+ 1
- 1
Marlin/src/lcd/menu/menu_bed_corners.cpp Vedi File

91
 }
91
 }
92
 
92
 
93
 void _lcd_level_bed_corners() {
93
 void _lcd_level_bed_corners() {
94
-  defer_return_to_status = true;
94
+  set_defer_return_to_status(true);
95
   if (!all_axes_known()) {
95
   if (!all_axes_known()) {
96
     set_all_unhomed();
96
     set_all_unhomed();
97
     enqueue_and_echo_commands_P(PSTR("G28"));
97
     enqueue_and_echo_commands_P(PSTR("G28"));

+ 1
- 1
Marlin/src/lcd/menu/menu_bed_leveling.cpp Vedi File

191
   // Step 2: Continue Bed Leveling...
191
   // Step 2: Continue Bed Leveling...
192
   //
192
   //
193
   void _lcd_level_bed_continue() {
193
   void _lcd_level_bed_continue() {
194
-    defer_return_to_status = true;
194
+    set_defer_return_to_status(true);
195
     set_all_unhomed();
195
     set_all_unhomed();
196
     lcd_goto_screen(_lcd_level_bed_homing);
196
     lcd_goto_screen(_lcd_level_bed_homing);
197
     enqueue_and_echo_commands_P(PSTR("G28"));
197
     enqueue_and_echo_commands_P(PSTR("G28"));

+ 1
- 1
Marlin/src/lcd/menu/menu_delta_calibrate.cpp Vedi File

50
   float lcd_probe_pt(const float &rx, const float &ry) {
50
   float lcd_probe_pt(const float &rx, const float &ry) {
51
     _man_probe_pt(rx, ry);
51
     _man_probe_pt(rx, ry);
52
     KEEPALIVE_STATE(PAUSED_FOR_USER);
52
     KEEPALIVE_STATE(PAUSED_FOR_USER);
53
-    defer_return_to_status = true;
53
+    set_defer_return_to_status(true);
54
     wait_for_user = true;
54
     wait_for_user = true;
55
     while (wait_for_user) idle();
55
     while (wait_for_user) idle();
56
     KEEPALIVE_STATE(IN_HANDLER);
56
     KEEPALIVE_STATE(IN_HANDLER);

+ 32
- 39
Marlin/src/lcd/menu/menu_filament.cpp Vedi File

458
 }
458
 }
459
 
459
 
460
 void lcd_advanced_pause_purge_message() {
460
 void lcd_advanced_pause_purge_message() {
461
-  START_SCREEN();
462
-  STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_1);
463
-  #ifdef MSG_FILAMENT_CHANGE_PURGE_2
464
-    STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_2);
465
-    #ifdef MSG_FILAMENT_CHANGE_PURGE_3
466
-      STATIC_ITEM(MSG_FILAMENT_CHANGE_PURGE_3);
461
+  _lcd_advanced_pause_message(
462
+    #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
463
+      PSTR(MSG_FILAMENT_CHANGE_CONT_PURGE_1)
464
+      #ifdef MSG_FILAMENT_CHANGE_CONT_PURGE_2
465
+        , PSTR(MSG_FILAMENT_CHANGE_CONT_PURGE_2)
466
+        #ifdef MSG_FILAMENT_CHANGE_CONT_PURGE_3
467
+          , PSTR(MSG_FILAMENT_CHANGE_CONT_PURGE_3)
468
+        #endif
469
+      #endif
470
+    #else
471
+      PSTR(MSG_FILAMENT_CHANGE_PURGE_1)
472
+      #ifdef MSG_FILAMENT_CHANGE_PURGE_2
473
+        , PSTR(MSG_FILAMENT_CHANGE_PURGE_2)
474
+        #ifdef MSG_FILAMENT_CHANGE_PURGE_3
475
+          , PSTR(MSG_FILAMENT_CHANGE_PURGE_3)
476
+        #endif
477
+      #endif
467
     #endif
478
     #endif
468
-  #endif
469
-  #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
470
-    #define _PURGE_BASE 3
471
-  #else
472
-    #define _PURGE_BASE 2
473
-  #endif
474
-  #if (_PURGE_BASE + defined(MSG_FILAMENT_CHANGE_PURGE_2) + defined(MSG_FILAMENT_CHANGE_PURGE_3)) < LCD_HEIGHT - 1
475
-    STATIC_ITEM(" ");
476
-  #endif
477
-  HOTEND_STATUS_ITEM();
478
-  #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
479
-    STATIC_ITEM(MSG_USERWAIT);
480
-  #endif
481
-  END_SCREEN();
479
+  );
482
 }
480
 }
483
 
481
 
484
 FORCE_INLINE screenFunc_t ap_message_screen(const AdvancedPauseMessage message) {
482
 FORCE_INLINE screenFunc_t ap_message_screen(const AdvancedPauseMessage message) {
485
   switch (message) {
483
   switch (message) {
486
-    case ADVANCED_PAUSE_MESSAGE_INIT:    return lcd_advanced_pause_init_message;
487
-    case ADVANCED_PAUSE_MESSAGE_UNLOAD:  return lcd_advanced_pause_unload_message;
488
-    case ADVANCED_PAUSE_MESSAGE_WAITING: return lcd_advanced_pause_waiting_message;
489
-    case ADVANCED_PAUSE_MESSAGE_INSERT:  return lcd_advanced_pause_insert_message;
490
-    case ADVANCED_PAUSE_MESSAGE_LOAD:    return lcd_advanced_pause_load_message;
491
-    #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
492
-      case ADVANCED_PAUSE_MESSAGE_CONTINUOUS_PURGE:
493
-    #else
494
-      case ADVANCED_PAUSE_MESSAGE_PURGE:
495
-    #endif
496
-                                         return lcd_advanced_pause_purge_message;
497
-    case ADVANCED_PAUSE_MESSAGE_RESUME:  return lcd_advanced_pause_resume_message;
498
-    case ADVANCED_PAUSE_MESSAGE_HEAT:    return lcd_advanced_pause_heat_message;
499
-    case ADVANCED_PAUSE_MESSAGE_HEATING: return lcd_advanced_pause_heating_message;
500
-    case ADVANCED_PAUSE_MESSAGE_OPTION:  advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_WAIT_FOR;
501
-                                         return menu_advanced_pause_option;
484
+    case ADVANCED_PAUSE_MESSAGE_INIT:     return lcd_advanced_pause_init_message;
485
+    case ADVANCED_PAUSE_MESSAGE_UNLOAD:   return lcd_advanced_pause_unload_message;
486
+    case ADVANCED_PAUSE_MESSAGE_WAITING:  return lcd_advanced_pause_waiting_message;
487
+    case ADVANCED_PAUSE_MESSAGE_INSERT:   return lcd_advanced_pause_insert_message;
488
+    case ADVANCED_PAUSE_MESSAGE_LOAD:     return lcd_advanced_pause_load_message;
489
+    case ADVANCED_PAUSE_MESSAGE_PURGE:    return lcd_advanced_pause_purge_message;
490
+    case ADVANCED_PAUSE_MESSAGE_RESUME:   return lcd_advanced_pause_resume_message;
491
+    case ADVANCED_PAUSE_MESSAGE_HEAT:     return lcd_advanced_pause_heat_message;
492
+    case ADVANCED_PAUSE_MESSAGE_HEATING:  return lcd_advanced_pause_heating_message;
493
+    case ADVANCED_PAUSE_MESSAGE_OPTION:   advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_WAIT_FOR;
494
+                                          return menu_advanced_pause_option;
502
     case ADVANCED_PAUSE_MESSAGE_STATUS:
495
     case ADVANCED_PAUSE_MESSAGE_STATUS:
503
     default: break;
496
     default: break;
504
   }
497
   }
507
 
500
 
508
 void lcd_advanced_pause_show_message(
501
 void lcd_advanced_pause_show_message(
509
   const AdvancedPauseMessage message,
502
   const AdvancedPauseMessage message,
510
-  const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_PAUSE_PRINT*/,
503
+  const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_SAME*/,
511
   const uint8_t extruder/*=active_extruder*/
504
   const uint8_t extruder/*=active_extruder*/
512
 ) {
505
 ) {
513
-  advanced_pause_mode = mode;
506
+  if (mode != ADVANCED_PAUSE_MODE_SAME) advanced_pause_mode = mode;
514
   hotend_status_extruder = extruder;
507
   hotend_status_extruder = extruder;
515
   const screenFunc_t next_screen = ap_message_screen(message);
508
   const screenFunc_t next_screen = ap_message_screen(message);
516
   if (next_screen) {
509
   if (next_screen) {
517
-    defer_return_to_status = true;
510
+    set_defer_return_to_status(true);
518
     lcd_goto_screen(next_screen);
511
     lcd_goto_screen(next_screen);
519
   }
512
   }
520
   else
513
   else

+ 1
- 1
Marlin/src/lcd/menu/menu_job_recovery.cpp Vedi File

95
 }
95
 }
96
 
96
 
97
 void menu_job_recovery() {
97
 void menu_job_recovery() {
98
-  defer_return_to_status = true;
98
+  set_defer_return_to_status(true);
99
   START_MENU();
99
   START_MENU();
100
   STATIC_ITEM(MSG_POWER_LOSS_RECOVERY);
100
   STATIC_ITEM(MSG_POWER_LOSS_RECOVERY);
101
   MENU_ITEM(function, MSG_RESUME_PRINT, lcd_power_loss_recovery_resume);
101
   MENU_ITEM(function, MSG_RESUME_PRINT, lcd_power_loss_recovery_resume);

+ 1
- 1
Marlin/src/lcd/menu/menu_motion.cpp Vedi File

241
 screenFunc_t _manual_move_func_ptr;
241
 screenFunc_t _manual_move_func_ptr;
242
 
242
 
243
 void _goto_manual_move(const float scale) {
243
 void _goto_manual_move(const float scale) {
244
-  defer_return_to_status = true;
244
+  set_defer_return_to_status(true);
245
   move_menu_scale = scale;
245
   move_menu_scale = scale;
246
   lcd_goto_screen(_manual_move_func_ptr);
246
   lcd_goto_screen(_manual_move_func_ptr);
247
 }
247
 }

+ 1
- 1
Marlin/src/lcd/menu/menu_sdcard.cpp Vedi File

62
     #endif
62
     #endif
63
 
63
 
64
     lcd_goto_screen(menu_sdcard, last_sdfile_encoderPosition);
64
     lcd_goto_screen(menu_sdcard, last_sdfile_encoderPosition);
65
-    defer_return_to_status = true;
65
+    set_defer_return_to_status(true);
66
     last_sdfile_encoderPosition = 0xFFFF;
66
     last_sdfile_encoderPosition = 0xFFFF;
67
 
67
 
68
     #if HAS_GRAPHICAL_LCD
68
     #if HAS_GRAPHICAL_LCD

+ 3
- 3
Marlin/src/lcd/menu/menu_tune.cpp Vedi File

78
   #if ENABLED(BABYSTEP_XY)
78
   #if ENABLED(BABYSTEP_XY)
79
     void _lcd_babystep_x() { _lcd_babystep(X_AXIS, PSTR(MSG_BABYSTEP_X)); }
79
     void _lcd_babystep_x() { _lcd_babystep(X_AXIS, PSTR(MSG_BABYSTEP_X)); }
80
     void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, PSTR(MSG_BABYSTEP_Y)); }
80
     void _lcd_babystep_y() { _lcd_babystep(Y_AXIS, PSTR(MSG_BABYSTEP_Y)); }
81
-    void lcd_babystep_x() { lcd_goto_screen(_lcd_babystep_x); babysteps_done = 0; defer_return_to_status = true; }
82
-    void lcd_babystep_y() { lcd_goto_screen(_lcd_babystep_y); babysteps_done = 0; defer_return_to_status = true; }
81
+    void lcd_babystep_x() { lcd_goto_screen(_lcd_babystep_x); babysteps_done = 0; set_defer_return_to_status(true); }
82
+    void lcd_babystep_y() { lcd_goto_screen(_lcd_babystep_y); babysteps_done = 0; set_defer_return_to_status(true); }
83
   #endif
83
   #endif
84
 
84
 
85
   #if DISABLED(BABYSTEP_ZPROBE_OFFSET)
85
   #if DISABLED(BABYSTEP_ZPROBE_OFFSET)
86
     void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, PSTR(MSG_BABYSTEP_Z)); }
86
     void _lcd_babystep_z() { _lcd_babystep(Z_AXIS, PSTR(MSG_BABYSTEP_Z)); }
87
-    void lcd_babystep_z() { lcd_goto_screen(_lcd_babystep_z); babysteps_done = 0; defer_return_to_status = true; }
87
+    void lcd_babystep_z() { lcd_goto_screen(_lcd_babystep_z); babysteps_done = 0; set_defer_return_to_status(true); }
88
   #endif
88
   #endif
89
 
89
 
90
 #endif // BABYSTEPPING
90
 #endif // BABYSTEPPING

+ 3
- 3
Marlin/src/lcd/menu/menu_ubl.cpp Vedi File

51
 static int16_t ubl_encoderPosition = 0;
51
 static int16_t ubl_encoderPosition = 0;
52
 
52
 
53
 static void _lcd_mesh_fine_tune(PGM_P msg) {
53
 static void _lcd_mesh_fine_tune(PGM_P msg) {
54
-  defer_return_to_status = true;
54
+  set_defer_return_to_status(true);
55
   if (ubl.encoder_diff) {
55
   if (ubl.encoder_diff) {
56
     ubl_encoderPosition = (ubl.encoder_diff > 0) ? 1 : -1;
56
     ubl_encoderPosition = (ubl.encoder_diff > 0) ? 1 : -1;
57
     ubl.encoder_diff = 0;
57
     ubl.encoder_diff = 0;
74
 }
74
 }
75
 
75
 
76
 void _lcd_mesh_edit_NOP() {
76
 void _lcd_mesh_edit_NOP() {
77
-  defer_return_to_status = true;
77
+  set_defer_return_to_status(true);
78
 }
78
 }
79
 
79
 
80
 float lcd_mesh_edit() {
80
 float lcd_mesh_edit() {
408
 void _lcd_ubl_output_map_lcd();
408
 void _lcd_ubl_output_map_lcd();
409
 
409
 
410
 void _lcd_ubl_map_homing() {
410
 void _lcd_ubl_map_homing() {
411
-  defer_return_to_status = true;
411
+  set_defer_return_to_status(true);
412
   _lcd_draw_homing();
412
   _lcd_draw_homing();
413
   if (all_axes_homed()) {
413
   if (all_axes_homed()) {
414
     ubl.lcd_map_control = true; // Return to the map screen
414
     ubl.lcd_map_control = true; // Return to the map screen

+ 9
- 2
Marlin/src/lcd/ultralcd.h Vedi File

281
     extern screenFunc_t currentScreen;
281
     extern screenFunc_t currentScreen;
282
     void lcd_goto_screen(const screenFunc_t screen, const uint32_t encoder=0);
282
     void lcd_goto_screen(const screenFunc_t screen, const uint32_t encoder=0);
283
 
283
 
284
-    extern bool lcd_clicked, defer_return_to_status;
284
+    extern bool lcd_clicked;
285
+    #if LCD_TIMEOUT_TO_STATUS
286
+      extern bool defer_return_to_status;
287
+      inline void set_defer_return_to_status(const bool defer) { defer_return_to_status = defer; }
288
+    #else
289
+      constexpr bool defer_return_to_status = false;
290
+      #define set_defer_return_to_status(D) NOOP
291
+    #endif
285
 
292
 
286
     extern int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2];
293
     extern int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2];
287
     extern uint8_t lcd_preheat_fan_speed[2];
294
     extern uint8_t lcd_preheat_fan_speed[2];
309
 
316
 
310
     #if ENABLED(ADVANCED_PAUSE_FEATURE)
317
     #if ENABLED(ADVANCED_PAUSE_FEATURE)
311
       void lcd_advanced_pause_show_message(const AdvancedPauseMessage message,
318
       void lcd_advanced_pause_show_message(const AdvancedPauseMessage message,
312
-                                           const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT,
319
+                                           const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_SAME,
313
                                            const uint8_t extruder=active_extruder);
320
                                            const uint8_t extruder=active_extruder);
314
     #endif
321
     #endif
315
 
322
 

Loading…
Annulla
Salva