Переглянути джерело

Clean up user-wait, SD completion (#17315)

Scott Lahteine 4 роки тому
джерело
коміт
747b964295
Аккаунт користувача з таким Email не знайдено

+ 4
- 0
Marlin/Configuration_adv.h Переглянути файл

@@ -1049,6 +1049,10 @@
1049 1049
 
1050 1050
   #define EVENT_GCODE_SD_STOP "G28XY"       // G-code to run on Stop Print (e.g., "G28XY" or "G27")
1051 1051
 
1052
+  #if ENABLED(PRINTER_EVENT_LEDS)
1053
+    #define PE_LEDS_COMPLETED_TIME  (30*60) // (seconds) Time to keep the LED "done" color before restoring normal illumination
1054
+  #endif
1055
+
1052 1056
   /**
1053 1057
    * Continue after Power-Loss (Creality3D)
1054 1058
    *

+ 21
- 48
Marlin/src/MarlinCore.cpp Переглянути файл

@@ -210,6 +210,24 @@ bool wait_for_heatup = true;
210 210
 // For M0/M1, this flag may be cleared (by M108) to exit the wait-for-user loop
211 211
 #if HAS_RESUME_CONTINUE
212 212
   bool wait_for_user; // = false;
213
+
214
+  void wait_for_user_response(millis_t ms/*=0*/, const bool no_sleep/*=false*/) {
215
+    #if DISABLED(ADVANCED_PAUSE_FEATURE)
216
+      UNUSED(no_sleep);
217
+    #endif
218
+    KEEPALIVE_STATE(PAUSED_FOR_USER);
219
+    wait_for_user = true;
220
+    if (ms) ms += millis(); // expire time
221
+    while (wait_for_user && !(ms && ELAPSED(millis(), ms))) {
222
+      idle(
223
+        #if ENABLED(ADVANCED_PAUSE_FEATURE)
224
+          no_sleep
225
+        #endif
226
+      );
227
+    }
228
+    wait_for_user = false;
229
+  }
230
+
213 231
 #endif
214 232
 
215 233
 // Inactivity shutdown
@@ -418,53 +436,8 @@ void startOrResumeJob() {
418 436
   }
419 437
 
420 438
   inline void finishSDPrinting() {
421
-
422
-    bool did_state = true;
423
-    switch (card.sdprinting_done_state) {
424
-
425
-      case 1:
426
-        if (print_job_timer.duration() > 60)
427
-          did_state = queue.enqueue_one_P(PSTR("M31"));
428
-        break;
429
-
430
-      case 2:
431
-        did_state = queue.enqueue_one_P(PSTR("M77"));
432
-        break;
433
-
434
-      case 3:
435
-        #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
436
-          ui.set_progress_done();
437
-        #endif
438
-        break;
439
-
440
-      case 4:                                   // Display "Click to Continue..."
441
-        #if HAS_LEDS_OFF_FLAG                   // 30 min timeout with LCD, 1 min without
442
-          did_state = queue.enqueue_one_P(
443
-            print_job_timer.duration() < 60 ? PSTR("M0Q1P1") : PSTR("M0Q1S" TERN(HAS_LCD_MENU, "1800", "60"))
444
-          );
445
-        #endif
446
-        break;
447
-
448
-      case 5:
449
-        #if ENABLED(POWER_LOSS_RECOVERY)
450
-          recovery.purge();
451
-        #endif
452
-
453
-        #if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND)
454
-          planner.finish_and_disable();
455
-        #endif
456
-
457
-        #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
458
-          ui.reselect_last_file();
459
-        #endif
460
-
461
-        SERIAL_ECHOLNPGM(STR_FILE_PRINTED);
462
-
463
-      default:
464
-        did_state = false;
465
-        card.sdprinting_done_state = 0;
466
-    }
467
-    if (did_state) ++card.sdprinting_done_state;
439
+    if (queue.enqueue_one_P(PSTR("M1001")))
440
+      marlin_state = MF_RUNNING;
468 441
   }
469 442
 
470 443
 #endif // SDSUPPORT
@@ -1209,7 +1182,7 @@ void loop() {
1209 1182
     #if ENABLED(SDSUPPORT)
1210 1183
       card.checkautostart();
1211 1184
       if (card.flag.abort_sd_printing) abortSDPrinting();
1212
-      if (card.sdprinting_done_state) finishSDPrinting();
1185
+      if (marlin_state == MF_SD_COMPLETE) finishSDPrinting();
1213 1186
     #endif
1214 1187
 
1215 1188
     queue.advance();

+ 2
- 0
Marlin/src/MarlinCore.h Переглянути файл

@@ -83,6 +83,7 @@ enum MarlinState : uint8_t {
83 83
   MF_PAUSED       = _BV(1),
84 84
   MF_WAITING      = _BV(2),
85 85
   MF_STOPPED      = _BV(3),
86
+  MF_SD_COMPLETE  = _BV(4),
86 87
   MF_KILLED       = _BV(7)
87 88
 };
88 89
 
@@ -98,6 +99,7 @@ extern bool wait_for_heatup;
98 99
 
99 100
 #if HAS_RESUME_CONTINUE
100 101
   extern bool wait_for_user;
102
+  void wait_for_user_response(millis_t ms=0, const bool no_sleep=false);
101 103
 #endif
102 104
 
103 105
 // Inactivity shutdown timer

+ 1
- 2
Marlin/src/feature/mmu2/mmu2.cpp Переглянути файл

@@ -707,14 +707,13 @@ void MMU2::filament_runout() {
707 707
     if (recover)  {
708 708
       LCD_MESSAGEPGM(MSG_MMU2_EJECT_RECOVER);
709 709
       BUZZ(200, 404);
710
-      wait_for_user = true;
711 710
       #if ENABLED(HOST_PROMPT_SUPPORT)
712 711
         host_prompt_do(PROMPT_USER_CONTINUE, PSTR("MMU2 Eject Recover"), CONTINUE_STR);
713 712
       #endif
714 713
       #if ENABLED(EXTENSIBLE_UI)
715 714
         ExtUI::onUserConfirmRequired_P(PSTR("MMU2 Eject Recover"));
716 715
       #endif
717
-      while (wait_for_user) idle();
716
+      wait_for_user_response();
718 717
       BUZZ(200, 404);
719 718
       BUZZ(200, 404);
720 719
 

+ 3
- 5
Marlin/src/feature/pause.cpp Переглянути файл

@@ -184,7 +184,6 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
184 184
     #endif
185 185
 
186 186
     KEEPALIVE_STATE(PAUSED_FOR_USER);
187
-    wait_for_user = true;    // LCD click or M108 will clear this
188 187
     #if ENABLED(HOST_PROMPT_SUPPORT)
189 188
       const char tool = '0'
190 189
         #if NUM_RUNOUT_SENSORS > 1
@@ -246,13 +245,13 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
246 245
       if (show_lcd) lcd_pause_show_message(PAUSE_MESSAGE_PURGE);
247 246
     #endif
248 247
 
249
-    wait_for_user = true;
250 248
     #if ENABLED(HOST_PROMPT_SUPPORT)
251 249
       host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Filament Purging..."), CONTINUE_STR);
252 250
     #endif
253 251
     #if ENABLED(EXTENSIBLE_UI)
254 252
       ExtUI::onUserConfirmRequired_P(PSTR("Filament Purging..."));
255 253
     #endif
254
+    wait_for_user = true; // A click or M108 breaks the purge_length loop
256 255
     for (float purge_count = purge_length; purge_count > 0 && wait_for_user; --purge_count)
257 256
       do_pause_e_move(1, ADVANCED_PAUSE_PURGE_FEEDRATE);
258 257
     wait_for_user = false;
@@ -508,13 +507,13 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
508 507
 
509 508
   // Wait for filament insert by user and press button
510 509
   KEEPALIVE_STATE(PAUSED_FOR_USER);
511
-  wait_for_user = true;    // LCD click or M108 will clear this
512 510
   #if ENABLED(HOST_PROMPT_SUPPORT)
513 511
     host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Nozzle Parked"), CONTINUE_STR);
514 512
   #endif
515 513
   #if ENABLED(EXTENSIBLE_UI)
516 514
     ExtUI::onUserConfirmRequired_P(PSTR("Nozzle Parked"));
517 515
   #endif
516
+  wait_for_user = true;    // LCD click or M108 will clear this
518 517
   while (wait_for_user) {
519 518
     #if HAS_BUZZER
520 519
       filament_change_beep(max_beep_count);
@@ -540,8 +539,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
540 539
         ExtUI::onUserConfirmRequired_P(PSTR("HeaterTimeout"));
541 540
       #endif
542 541
 
543
-      // Wait for LCD click or M108
544
-      while (wait_for_user) idle_no_sleep();
542
+      wait_for_user_response(0, true); // Wait for LCD click or M108
545 543
 
546 544
       #if ENABLED(HOST_PROMPT_SUPPORT)
547 545
         host_prompt_do(PROMPT_INFO, PSTR("Reheating"));

+ 5
- 1
Marlin/src/gcode/gcode.cpp Переглянути файл

@@ -857,7 +857,11 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
857 857
 
858 858
       #if ENABLED(POWER_LOSS_RECOVERY)
859 859
         case 413: M413(); break;                                  // M413: Enable/disable/query Power-Loss Recovery
860
-        case 1000: M1000(); break;                                // M1000: Resume from power-loss
860
+        case 1000: M1000(); break;                                // M1000: [INTERNAL] Resume from power-loss
861
+      #endif
862
+
863
+      #if ENABLED(SDSUPPORT)
864
+        case 1001: M1001(); break;                                // M1001: [INTERNAL] Handle SD completion
861 865
       #endif
862 866
 
863 867
       #if ENABLED(MAX7219_GCODE)

+ 4
- 0
Marlin/src/gcode/gcode.h Переглянути файл

@@ -968,6 +968,10 @@ private:
968 968
     static void M1000();
969 969
   #endif
970 970
 
971
+  #if ENABLED(SDSUPPORT)
972
+    static void M1001();
973
+  #endif
974
+
971 975
   #if ENABLED(MAX7219_GCODE)
972 976
     static void M7219();
973 977
   #endif

+ 13
- 36
Marlin/src/gcode/lcd/M0_M1.cpp Переглянути файл

@@ -24,23 +24,19 @@
24 24
 
25 25
 #if HAS_RESUME_CONTINUE
26 26
 
27
+#include "../../inc/MarlinConfig.h"
28
+
27 29
 #include "../gcode.h"
28
-#include "../../module/planner.h"
29 30
 
30
-#include "../../inc/MarlinConfig.h"
31
+#include "../../module/planner.h" // for synchronize()
32
+#include "../../MarlinCore.h"     // for wait_for_user_response()
31 33
 
32 34
 #if HAS_LCD_MENU
33 35
   #include "../../lcd/ultralcd.h"
34
-#endif
35
-
36
-#if ENABLED(EXTENSIBLE_UI)
36
+#elif ENABLED(EXTENSIBLE_UI)
37 37
   #include "../../lcd/extui/ui_api.h"
38 38
 #endif
39 39
 
40
-#if HAS_LEDS_OFF_FLAG
41
-  #include "../../feature/leds/printer_event_leds.h"
42
-#endif
43
-
44 40
 #if ENABLED(HOST_PROMPT_SUPPORT)
45 41
   #include "../../feature/host_actions.h"
46 42
 #endif
@@ -56,18 +52,11 @@ void GcodeSuite::M0_M1() {
56 52
 
57 53
   planner.synchronize();
58 54
 
59
-  #if HAS_LEDS_OFF_FLAG
60
-    const bool seenQ = parser.seen('Q');
61
-    if (seenQ) printerEventLEDs.onPrintCompleted();  // Change LED color for Print Completed
62
-  #else
63
-    constexpr bool seenQ = false;
64
-  #endif
65
-
66 55
   #if HAS_LCD_MENU
67 56
 
68 57
     if (parser.string_arg)
69 58
       ui.set_status(parser.string_arg, true);
70
-    else if (!seenQ) {
59
+    else {
71 60
       LCD_MESSAGEPGM(MSG_USERWAIT);
72 61
       #if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
73 62
         ui.reset_progress_bar_timeout();
@@ -75,12 +64,10 @@ void GcodeSuite::M0_M1() {
75 64
     }
76 65
 
77 66
   #elif ENABLED(EXTENSIBLE_UI)
78
-    if (!seenQ) {
79
-      if (parser.string_arg)
80
-        ExtUI::onUserConfirmRequired(parser.string_arg); // Can this take an SRAM string??
81
-      else
82
-        ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_USERWAIT));
83
-    }
67
+    if (parser.string_arg)
68
+      ExtUI::onUserConfirmRequired(parser.string_arg); // Can this take an SRAM string??
69
+    else
70
+      ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_USERWAIT));
84 71
   #else
85 72
 
86 73
     if (parser.string_arg) {
@@ -90,25 +77,15 @@ void GcodeSuite::M0_M1() {
90 77
 
91 78
   #endif
92 79
 
93
-  KEEPALIVE_STATE(PAUSED_FOR_USER);
94
-  wait_for_user = true;
95
-
96 80
   #if ENABLED(HOST_PROMPT_SUPPORT)
97
-    if (!seenQ) host_prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? PSTR("M1 Stop") : PSTR("M0 Stop"), CONTINUE_STR);
81
+    host_prompt_do(PROMPT_USER_CONTINUE, parser.codenum ? PSTR("M1 Stop") : PSTR("M0 Stop"), CONTINUE_STR);
98 82
   #endif
99 83
 
100
-  if (ms > 0) ms += millis();  // wait until this time for a click
101
-  while (wait_for_user && (ms == 0 || PENDING(millis(), ms))) idle();
102
-
103
-  #if HAS_LEDS_OFF_FLAG
104
-    printerEventLEDs.onResumeAfterWait();
105
-  #endif
84
+  wait_for_user_response(ms);
106 85
 
107 86
   #if HAS_LCD_MENU
108
-    if (!seenQ) ui.reset_status();
87
+    ui.reset_status();
109 88
   #endif
110
-
111
-  wait_for_user = false;
112 89
 }
113 90
 
114 91
 #endif // HAS_RESUME_CONTINUE

+ 109
- 0
Marlin/src/gcode/sd/M1001.cpp Переглянути файл

@@ -0,0 +1,109 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(SDSUPPORT)
26
+
27
+#include "../gcode.h"
28
+#include "../../module/printcounter.h"
29
+
30
+#if EITHER(LCD_SET_PROGRESS_MANUALLY, SD_REPRINT_LAST_SELECTED_FILE)
31
+  #include "../../lcd/ultralcd.h"
32
+#endif
33
+
34
+#if ENABLED(POWER_LOSS_RECOVERY)
35
+  #include "../../feature/powerloss.h"
36
+#endif
37
+
38
+#if HAS_LEDS_OFF_FLAG
39
+  #include "../../feature/leds/printer_event_leds.h"
40
+#endif
41
+
42
+#if ENABLED(EXTENSIBLE_UI)
43
+  #include "../../lcd/extui/ui_api.h"
44
+#endif
45
+
46
+#if ENABLED(HOST_ACTION_COMMANDS)
47
+  #include "../../feature/host_actions.h"
48
+#endif
49
+
50
+#if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND)
51
+  #include "../../module/planner.h"
52
+#endif
53
+
54
+#ifndef PE_LEDS_COMPLETED_TIME
55
+  #define PE_LEDS_COMPLETED_TIME (30*60)
56
+#endif
57
+
58
+/**
59
+ * M1001: Execute actions for SD print completion
60
+ */
61
+void GcodeSuite::M1001() {
62
+
63
+  // Report total print time
64
+  const bool long_print = print_job_timer.duration() > 60;
65
+  if (long_print) gcode.process_subcommands_now_P(PSTR("M31"));
66
+
67
+  // Stop the print job timer
68
+  gcode.process_subcommands_now_P(PSTR("M77"));
69
+
70
+  // Set the progress bar "done" state
71
+  #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
72
+    ui.set_progress_done();
73
+  #endif
74
+
75
+  // Purge the recovery file
76
+  #if ENABLED(POWER_LOSS_RECOVERY)
77
+    recovery.purge();
78
+  #endif
79
+
80
+  // Announce SD file completion
81
+  SERIAL_ECHOLNPGM(STR_FILE_PRINTED);
82
+
83
+  // Update the status LED color
84
+  #if HAS_LEDS_OFF_FLAG
85
+    if (long_print) {
86
+      printerEventLEDs.onPrintCompleted();
87
+      #if ENABLED(EXTENSIBLE_UI)
88
+        ExtUI::onUserConfirmRequired_P(GET_TEXT(MSG_PRINT_DONE));
89
+      #endif
90
+      #if ENABLED(HOST_PROMPT_SUPPORT)
91
+        host_prompt_do(PROMPT_USER_CONTINUE, GET_TEXT(MSG_PRINT_DONE), CONTINUE_STR);
92
+      #endif
93
+      wait_for_user_response(1000UL * TERN(HAS_LCD_MENU, PE_LEDS_COMPLETED_TIME, 30));
94
+      printerEventLEDs.onResumeAfterWait();
95
+    }
96
+  #endif
97
+
98
+  // Wait for the queue to empty (and "clean"), inject SD_FINISHED_RELEASECOMMAND
99
+  #if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND)
100
+    planner.finish_and_disable();
101
+  #endif
102
+
103
+  // Re-select the last printed file in the UI
104
+  #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
105
+    ui.reselect_last_file();
106
+  #endif
107
+}
108
+
109
+#endif // SDSUPPORT

+ 1
- 0
Marlin/src/lcd/language/language_en.h Переглянути файл

@@ -352,6 +352,7 @@ namespace Language_en {
352 352
   PROGMEM Language_Str MSG_PRINT_PAUSED                    = _UxGT("Print Paused");
353 353
   PROGMEM Language_Str MSG_PRINTING                        = _UxGT("Printing...");
354 354
   PROGMEM Language_Str MSG_PRINT_ABORTED                   = _UxGT("Print Aborted");
355
+  PROGMEM Language_Str MSG_PRINT_DONE                      = _UxGT("Print Done");
355 356
   PROGMEM Language_Str MSG_NO_MOVE                         = _UxGT("No Move.");
356 357
   PROGMEM Language_Str MSG_KILLED                          = _UxGT("KILLED. ");
357 358
   PROGMEM Language_Str MSG_STOPPED                         = _UxGT("STOPPED. ");

+ 1
- 3
Marlin/src/lcd/menu/menu_delta_calibrate.cpp Переглянути файл

@@ -61,16 +61,14 @@ void _man_probe_pt(const xy_pos_t &xy) {
61 61
 
62 62
   float lcd_probe_pt(const xy_pos_t &xy) {
63 63
     _man_probe_pt(xy);
64
-    KEEPALIVE_STATE(PAUSED_FOR_USER);
65 64
     ui.defer_status_screen();
66
-    wait_for_user = true;
67 65
     #if ENABLED(HOST_PROMPT_SUPPORT)
68 66
       host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Delta Calibration in progress"), CONTINUE_STR);
69 67
     #endif
70 68
     #if ENABLED(EXTENSIBLE_UI)
71 69
       ExtUI::onUserConfirmRequired_P(PSTR("Delta Calibration in progress"));
72 70
     #endif
73
-    while (wait_for_user) idle();
71
+    wait_for_user_response();
74 72
     ui.goto_previous_screen_no_defer();
75 73
     return current_position.z;
76 74
   }

+ 10
- 12
Marlin/src/lcd/ultralcd.cpp Переглянути файл

@@ -776,6 +776,13 @@ void MarlinUI::update() {
776 776
     // If the action button is pressed...
777 777
     static bool wait_for_unclick; // = false
778 778
 
779
+    auto do_click = [&]{
780
+      wait_for_unclick = true;                        //  - Set debounce flag to ignore continous clicks
781
+      lcd_clicked = !wait_for_user && !no_reentry;    //  - Keep the click if not waiting for a user-click
782
+      wait_for_user = false;                          //  - Any click clears wait for user
783
+      quick_feedback();                               //  - Always make a click sound
784
+    };
785
+
779 786
     #if ENABLED(TOUCH_BUTTONS)
780 787
       if (touch_buttons) {
781 788
         RESET_STATUS_TIMEOUT();
@@ -796,12 +803,8 @@ void MarlinUI::update() {
796 803
             }
797 804
           }
798 805
         }
799
-        else if (!wait_for_unclick && (buttons & EN_C)) { // OK button, if not waiting for a debounce release:
800
-          wait_for_unclick = true;                        //  - Set debounce flag to ignore continous clicks
801
-          lcd_clicked = !wait_for_user && !no_reentry;    //  - Keep the click if not waiting for a user-click
802
-          wait_for_user = false;                          //  - Any click clears wait for user
803
-          quick_feedback();                               //  - Always make a click sound
804
-        }
806
+        else if (!wait_for_unclick && (buttons & EN_C))   // OK button, if not waiting for a debounce release:
807
+          do_click();
805 808
       }
806 809
       else // keep wait_for_unclick value
807 810
 
@@ -810,12 +813,7 @@ void MarlinUI::update() {
810 813
       {
811 814
         // Integrated LCD click handling via button_pressed
812 815
         if (!external_control && button_pressed()) {
813
-          if (!wait_for_unclick) {                        // If not waiting for a debounce release:
814
-            wait_for_unclick = true;                      //  - Set debounce flag to ignore continous clicks
815
-            lcd_clicked = !wait_for_user && !no_reentry;  //  - Keep the click if not waiting for a user-click
816
-            wait_for_user = false;                        //  - Any click clears wait for user
817
-            quick_feedback();                             //  - Always make a click sound
818
-          }
816
+          if (!wait_for_unclick) do_click();              // Handle the click
819 817
         }
820 818
         else
821 819
           wait_for_unclick = false;

+ 3
- 7
Marlin/src/module/probe.cpp Переглянути файл

@@ -134,12 +134,10 @@ xyz_pos_t Probe::offset; // Initialized by settings.load()
134 134
       LCD_MESSAGEPGM(MSG_MANUAL_DEPLOY_TOUCHMI);
135 135
       ui.return_to_status();
136 136
 
137
-      KEEPALIVE_STATE(PAUSED_FOR_USER);
138
-      wait_for_user = true; // LCD click or M108 will clear this
139 137
       #if ENABLED(HOST_PROMPT_SUPPORT)
140
-        host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Deploy TouchMI probe."), CONTINUE_STR);
138
+        host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Deploy TouchMI"), CONTINUE_STR);
141 139
       #endif
142
-      while (wait_for_user) idle();
140
+      wait_for_user_response();
143 141
       ui.reset_status();
144 142
       ui.goto_screen(prev_screen);
145 143
 
@@ -297,15 +295,13 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
297 295
       serialprintPGM(ds_str);
298 296
       SERIAL_EOL();
299 297
 
300
-      KEEPALIVE_STATE(PAUSED_FOR_USER);
301
-      wait_for_user = true;
302 298
       #if ENABLED(HOST_PROMPT_SUPPORT)
303 299
         host_prompt_do(PROMPT_USER_CONTINUE, PSTR("Stow Probe"), CONTINUE_STR);
304 300
       #endif
305 301
       #if ENABLED(EXTENSIBLE_UI)
306 302
         ExtUI::onUserConfirmRequired_P(PSTR("Stow Probe"));
307 303
       #endif
308
-      while (wait_for_user) idle();
304
+      wait_for_user_response();
309 305
       ui.reset_status();
310 306
 
311 307
     } while(

+ 1
- 2
Marlin/src/sd/cardreader.cpp Переглянути файл

@@ -49,7 +49,6 @@
49 49
 // public:
50 50
 
51 51
 card_flags_t CardReader::flag;
52
-uint8_t CardReader::sdprinting_done_state;
53 52
 char CardReader::filename[FILENAME_LENGTH], CardReader::longFilename[LONG_FILENAME_LENGTH];
54 53
 int8_t CardReader::autostart_index;
55 54
 
@@ -1089,7 +1088,7 @@ void CardReader::fileHasFinished() {
1089 1088
       presort();
1090 1089
     #endif
1091 1090
 
1092
-    sdprinting_done_state = 1;
1091
+    marlin_state = MF_SD_COMPLETE;
1093 1092
   }
1094 1093
 }
1095 1094
 

+ 0
- 1
Marlin/src/sd/cardreader.h Переглянути файл

@@ -49,7 +49,6 @@ typedef struct {
49 49
 
50 50
 class CardReader {
51 51
 public:
52
-  static uint8_t sdprinting_done_state;
53 52
   static card_flags_t flag;                         // Flags (above)
54 53
   static char filename[FILENAME_LENGTH],            // DOS 8.3 filename of the selected item
55 54
               longFilename[LONG_FILENAME_LENGTH];   // Long name of the selected item

Завантаження…
Відмінити
Зберегти