Sfoglia il codice sorgente

Show print time with PRINTER_EVENT_LEDS

Scott Lahteine 4 anni fa
parent
commit
0ce83dee95
2 ha cambiato i file con 5 aggiunte e 10 eliminazioni
  1. 3
    7
      Marlin/src/gcode/lcd/M0_M1.cpp
  2. 2
    3
      Marlin/src/gcode/queue.cpp

+ 3
- 7
Marlin/src/gcode/lcd/M0_M1.cpp Vedi File

@@ -71,7 +71,7 @@ void GcodeSuite::M0_M1() {
71 71
 
72 72
     if (has_message)
73 73
       ui.set_status(args, true);
74
-    else {
74
+    else if (!parser.seenval('Q')) {
75 75
       LCD_MESSAGEPGM(MSG_USERWAIT);
76 76
       #if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
77 77
         ui.reset_progress_bar_timeout();
@@ -101,12 +101,8 @@ void GcodeSuite::M0_M1() {
101 101
     host_prompt_do(PROMPT_USER_CONTINUE, PSTR("M0/1 Break Called"), CONTINUE_STR);
102 102
   #endif
103 103
 
104
-  if (ms > 0) {
105
-    ms += millis();  // wait until this time for a click
106
-    while (PENDING(millis(), ms) && wait_for_user) idle();
107
-  }
108
-  else
109
-    while (wait_for_user) idle();
104
+  if (ms > 0) ms += millis();  // wait until this time for a click
105
+  while (wait_for_user && (ms > 0 || PENDING(millis(), ms))) idle();
110 106
 
111 107
   #if HAS_LEDS_OFF_FLAG
112 108
     printerEventLEDs.onResumeAfterWait();

+ 2
- 3
Marlin/src/gcode/queue.cpp Vedi File

@@ -163,8 +163,7 @@ bool GCodeQueue::enqueue_one(const char* cmd) {
163 163
   if (*cmd == 0 || *cmd == '\n' || *cmd == '\r') return true;
164 164
 
165 165
   if (_enqueue(cmd)) {
166
-    SERIAL_ECHO_START();
167
-    SERIAL_ECHOLNPAIR(MSG_ENQUEUEING, cmd, "\"");
166
+    SERIAL_ECHO_MSG(MSG_ENQUEUEING, cmd, "\"");
168 167
     return true;
169 168
   }
170 169
   return false;
@@ -517,7 +516,7 @@ void GCodeQueue::get_serial_commands() {
517 516
             #if ENABLED(PRINTER_EVENT_LEDS)
518 517
               printerEventLEDs.onPrintCompleted();
519 518
               #if HAS_RESUME_CONTINUE
520
-                inject_P(PSTR("M0 S"
519
+                inject_P(PSTR("M0 Q S"
521 520
                   #if HAS_LCD_MENU
522 521
                     "1800"
523 522
                   #else

Loading…
Annulla
Salva