소스 검색

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 5 년 전
부모
커밋
e574f01568
No account linked to committer's email address

+ 4
- 1
Marlin/src/Marlin.cpp 파일 보기

@@ -369,7 +369,10 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
369 369
         disable_e_steppers();
370 370
       #endif
371 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 376
       #endif
374 377
     }
375 378
   }

+ 17
- 27
Marlin/src/feature/pause.cpp 파일 보기

@@ -92,7 +92,7 @@ fil_change_settings_t fc_settings[EXTRUDERS];
92 92
  *
93 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 97
   #if ENABLED(PREVENT_COLD_EXTRUSION)
98 98
     if (!DEBUGGING(DRYRUN) && thermalManager.targetTooColdToExtrude(active_extruder)) {
@@ -134,23 +134,16 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
134 134
                    const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_PAUSE_PRINT*/
135 135
                    DXC_ARGS
136 136
 ) {
137
-  #if DISABLED(ULTIPANEL)
138
-    UNUSED(show_lcd);
139
-  #endif
140
-
141 137
   if (!ensure_safe_temperature(mode)) {
142 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 140
     #endif
146
-
147 141
     return false;
148 142
   }
149 143
 
150 144
   if (pause_for_user) {
151 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 147
     #endif
155 148
     SERIAL_ECHO_START();
156 149
     SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_INSERT);
@@ -173,8 +166,9 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
173 166
   }
174 167
 
175 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 172
   #endif
179 173
 
180 174
   #if ENABLED(DUAL_X_CARRIAGE)
@@ -210,8 +204,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
210 204
   #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
211 205
 
212 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 208
     #endif
216 209
 
217 210
     wait_for_user = true;
@@ -225,8 +218,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
225 218
       if (purge_length > 0) {
226 219
         // "Wait for filament purge"
227 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 222
         #endif
231 223
 
232 224
         // Extrude filament to get into hotend
@@ -238,7 +230,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
238 230
         if (show_lcd) {
239 231
           KEEPALIVE_STATE(PAUSED_FOR_USER);
240 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 234
           while (advanced_pause_menu_response == ADVANCED_PAUSE_RESPONSE_WAIT_FOR) idle(true);
243 235
           KEEPALIVE_STATE(IN_HANDLER);
244 236
         }
@@ -273,18 +265,16 @@ bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/,
273 265
 ) {
274 266
   if (!ensure_safe_temperature(mode)) {
275 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 269
     #endif
279 270
 
280 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 276
   #else
286
-    if (show_lcd)
287
-      lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_UNLOAD, mode);
277
+    UNUSED(show_lcd);
288 278
   #endif
289 279
 
290 280
   // Retract filament
@@ -343,8 +333,9 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u
343 333
   #endif
344 334
 
345 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 339
   #endif
349 340
 
350 341
   if (!DEBUGGING(DRYRUN) && unload_length && thermalManager.targetTooColdToExtrude(active_extruder)) {
@@ -549,7 +540,7 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le
549 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 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 544
   #endif
554 545
 
555 546
   // Intelligent resuming
@@ -577,7 +568,6 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le
577 568
   #endif
578 569
 
579 570
   #if HAS_LCD_MENU
580
-    // Show status screen
581 571
     lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
582 572
   #endif
583 573
 

+ 2
- 5
Marlin/src/feature/pause.h 파일 보기

@@ -37,6 +37,7 @@ typedef struct {
37 37
 #include "../libs/nozzle.h"
38 38
 
39 39
 enum AdvancedPauseMode : char {
40
+  ADVANCED_PAUSE_MODE_SAME,
40 41
   ADVANCED_PAUSE_MODE_PAUSE_PRINT,
41 42
   ADVANCED_PAUSE_MODE_LOAD_FILAMENT,
42 43
   ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT
@@ -48,11 +49,7 @@ enum AdvancedPauseMessage : char {
48 49
   ADVANCED_PAUSE_MESSAGE_UNLOAD,
49 50
   ADVANCED_PAUSE_MESSAGE_INSERT,
50 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 53
   ADVANCED_PAUSE_MESSAGE_OPTION,
57 54
   ADVANCED_PAUSE_MESSAGE_RESUME,
58 55
   ADVANCED_PAUSE_MESSAGE_STATUS,

+ 4
- 1
Marlin/src/gcode/control/M17_M18_M84.cpp 파일 보기

@@ -61,7 +61,10 @@ void GcodeSuite::M18_M84() {
61 61
     }
62 62
 
63 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 68
     #endif
66 69
   }
67 70
 }

+ 2
- 2
Marlin/src/inc/SanityCheck.h 파일 보기

@@ -1115,8 +1115,8 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE,
1115 1115
  * LCD_BED_LEVELING requirements
1116 1116
  */
1117 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 1120
   #elif !(ENABLED(MESH_BED_LEVELING) || OLDSCHOOL_ABL)
1121 1121
     #error "LCD_BED_LEVELING requires MESH_BED_LEVELING or AUTO_BED_LEVELING."
1122 1122
   #endif

+ 7
- 0
Marlin/src/lcd/language/language_en.h 파일 보기

@@ -1131,6 +1131,10 @@
1131 1131
     #define MSG_FILAMENT_CHANGE_PURGE_1       _UxGT("Wait for")
1132 1132
     #define MSG_FILAMENT_CHANGE_PURGE_2       _UxGT("filament purge")
1133 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 1138
   #ifndef MSG_FILAMENT_CHANGE_RESUME_1
1135 1139
     #define MSG_FILAMENT_CHANGE_RESUME_1      _UxGT("Wait for print")
1136 1140
     #define MSG_FILAMENT_CHANGE_RESUME_2      _UxGT("to resume...")
@@ -1160,6 +1164,9 @@
1160 1164
   #ifndef MSG_FILAMENT_CHANGE_PURGE_1
1161 1165
     #define MSG_FILAMENT_CHANGE_PURGE_1       _UxGT("Purging...")
1162 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 1170
   #ifndef MSG_FILAMENT_CHANGE_RESUME_1
1164 1171
     #define MSG_FILAMENT_CHANGE_RESUME_1      _UxGT("Resuming...")
1165 1172
   #endif

+ 13
- 7
Marlin/src/lcd/menu/menu.cpp 파일 보기

@@ -59,7 +59,11 @@ typedef struct {
59 59
 } menuPosition;
60 60
 menuPosition screen_history[6];
61 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 68
 // Value Editing
65 69
 PGM_P editLabel;
@@ -97,10 +101,12 @@ void lcd_goto_previous_menu() {
97 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 112
 /////////// Common Menu Actions ////////////
@@ -234,7 +240,7 @@ void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder/*=0*/) {
234 240
     currentScreen = screen;
235 241
     encoderPosition = encoder;
236 242
     if (screen == lcd_status_screen) {
237
-      defer_return_to_status = false;
243
+      set_defer_return_to_status(false);
238 244
       #if ENABLED(AUTO_BED_LEVELING_UBL)
239 245
         ubl.lcd_map_control = false;
240 246
       #endif
@@ -343,7 +349,7 @@ void lcd_completion_feedback(const bool good/*=true*/) {
343 349
 
344 350
   void lcd_babystep_zoffset() {
345 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 353
     #if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
348 354
       const bool do_probe = (active_extruder == 0);
349 355
     #else

+ 6
- 2
Marlin/src/lcd/menu/menu.h 파일 보기

@@ -35,9 +35,13 @@ void scroll_screen(const uint8_t limit, const bool is_menu);
35 35
 bool use_click();
36 36
 bool printer_busy();
37 37
 void lcd_completion_feedback(const bool good=true);
38
-void lcd_goto_previous_menu();
39
-void lcd_goto_previous_menu_no_defer();
40 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 47
 ////////// Menu Item Numeric Types /////////

+ 1
- 1
Marlin/src/lcd/menu/menu_bed_corners.cpp 파일 보기

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

+ 1
- 1
Marlin/src/lcd/menu/menu_bed_leveling.cpp 파일 보기

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

+ 1
- 1
Marlin/src/lcd/menu/menu_delta_calibrate.cpp 파일 보기

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

+ 32
- 39
Marlin/src/lcd/menu/menu_filament.cpp 파일 보기

@@ -458,47 +458,40 @@ void lcd_advanced_pause_resume_message() {
458 458
 }
459 459
 
460 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 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 482
 FORCE_INLINE screenFunc_t ap_message_screen(const AdvancedPauseMessage message) {
485 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 495
     case ADVANCED_PAUSE_MESSAGE_STATUS:
503 496
     default: break;
504 497
   }
@@ -507,14 +500,14 @@ FORCE_INLINE screenFunc_t ap_message_screen(const AdvancedPauseMessage message)
507 500
 
508 501
 void lcd_advanced_pause_show_message(
509 502
   const AdvancedPauseMessage message,
510
-  const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_PAUSE_PRINT*/,
503
+  const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_SAME*/,
511 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 507
   hotend_status_extruder = extruder;
515 508
   const screenFunc_t next_screen = ap_message_screen(message);
516 509
   if (next_screen) {
517
-    defer_return_to_status = true;
510
+    set_defer_return_to_status(true);
518 511
     lcd_goto_screen(next_screen);
519 512
   }
520 513
   else

+ 1
- 1
Marlin/src/lcd/menu/menu_job_recovery.cpp 파일 보기

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

+ 1
- 1
Marlin/src/lcd/menu/menu_motion.cpp 파일 보기

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

+ 1
- 1
Marlin/src/lcd/menu/menu_sdcard.cpp 파일 보기

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

+ 3
- 3
Marlin/src/lcd/menu/menu_tune.cpp 파일 보기

@@ -78,13 +78,13 @@ void _lcd_refresh_e_factor_0() { planner.refresh_e_factor(0); }
78 78
   #if ENABLED(BABYSTEP_XY)
79 79
     void _lcd_babystep_x() { _lcd_babystep(X_AXIS, PSTR(MSG_BABYSTEP_X)); }
80 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 83
   #endif
84 84
 
85 85
   #if DISABLED(BABYSTEP_ZPROBE_OFFSET)
86 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 88
   #endif
89 89
 
90 90
 #endif // BABYSTEPPING

+ 3
- 3
Marlin/src/lcd/menu/menu_ubl.cpp 파일 보기

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

+ 9
- 2
Marlin/src/lcd/ultralcd.h 파일 보기

@@ -281,7 +281,14 @@
281 281
     extern screenFunc_t currentScreen;
282 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 293
     extern int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2];
287 294
     extern uint8_t lcd_preheat_fan_speed[2];
@@ -309,7 +316,7 @@
309 316
 
310 317
     #if ENABLED(ADVANCED_PAUSE_FEATURE)
311 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 320
                                            const uint8_t extruder=active_extruder);
314 321
     #endif
315 322
 

Loading…
취소
저장