Scott Lahteine преди 7 години
родител
ревизия
55e9b85ad6
променени са 1 файла, в които са добавени 13 реда и са изтрити 9 реда
  1. 13
    9
      Marlin/src/gcode/lcd/M0_M1.cpp

+ 13
- 9
Marlin/src/gcode/lcd/M0_M1.cpp Целия файл

56
     hasS = ms > 0;
56
     hasS = ms > 0;
57
   }
57
   }
58
 
58
 
59
+  const bool has_message = !hasP && !hasS && args && *args;
60
+
59
   #if ENABLED(ULTIPANEL)
61
   #if ENABLED(ULTIPANEL)
60
 
62
 
61
-    if (!hasP && !hasS && args && *args)
63
+    if (has_message)
62
       lcd_setstatus(args, true);
64
       lcd_setstatus(args, true);
63
     else {
65
     else {
64
       LCD_MESSAGEPGM(MSG_USERWAIT);
66
       LCD_MESSAGEPGM(MSG_USERWAIT);
69
 
71
 
70
   #else
72
   #else
71
 
73
 
72
-    if (!hasP && !hasS && args && *args) {
74
+    if (has_message) {
73
       SERIAL_ECHO_START();
75
       SERIAL_ECHO_START();
74
       SERIAL_ECHOLN(args);
76
       SERIAL_ECHOLN(args);
75
     }
77
     }
82
   stepper.synchronize();
84
   stepper.synchronize();
83
 
85
 
84
   if (ms > 0) {
86
   if (ms > 0) {
85
-    ms += previous_move_ms;  // wait until this time for a click
87
+    ms += millis();  // wait until this time for a click
86
     while (PENDING(millis(), ms) && wait_for_user) idle();
88
     while (PENDING(millis(), ms) && wait_for_user) idle();
87
   }
89
   }
88
   else {
90
   else {
89
     #if ENABLED(ULTIPANEL)
91
     #if ENABLED(ULTIPANEL)
90
-      if (lcd_detected()) {
91
-        while (wait_for_user) idle();
92
-        IS_SD_PRINTING ? LCD_MESSAGEPGM(MSG_RESUMING) : LCD_MESSAGEPGM(WELCOME_MSG);
93
-      }
94
-    #else
95
-      while (wait_for_user) idle();
92
+      if (lcd_detected())
96
     #endif
93
     #endif
94
+        while (wait_for_user) idle();
97
   }
95
   }
98
 
96
 
99
   #if ENABLED(PRINTER_EVENT_LEDS) && ENABLED(SDSUPPORT)
97
   #if ENABLED(PRINTER_EVENT_LEDS) && ENABLED(SDSUPPORT)
103
     }
101
     }
104
   #endif
102
   #endif
105
 
103
 
104
+  #if ENABLED(ULTIPANEL)
105
+    if (lcd_detected()) {
106
+      IS_SD_PRINTING ? LCD_MESSAGEPGM(MSG_RESUMING) : LCD_MESSAGEPGM(WELCOME_MSG);
107
+    }
108
+  #endif
109
+
106
   wait_for_user = false;
110
   wait_for_user = false;
107
   KEEPALIVE_STATE(IN_HANDLER);
111
   KEEPALIVE_STATE(IN_HANDLER);
108
 }
112
 }

Loading…
Отказ
Запис