Browse Source

Tweaks to finishSDPrinting (#17082)

Scott Lahteine 4 years ago
parent
commit
e7004550c4
No account linked to committer's email address
2 changed files with 22 additions and 14 deletions
  1. 17
    12
      Marlin/src/MarlinCore.cpp
  2. 5
    2
      Marlin/src/gcode/lcd/M0_M1.cpp

+ 17
- 12
Marlin/src/MarlinCore.cpp View File

418
   }
418
   }
419
 
419
 
420
   inline void finishSDPrinting() {
420
   inline void finishSDPrinting() {
421
+
421
     bool did_state = true;
422
     bool did_state = true;
422
     switch (card.sdprinting_done_state) {
423
     switch (card.sdprinting_done_state) {
423
 
424
 
424
-      #if HAS_RESUME_CONTINUE                   // Display "Click to Continue..."
425
-        case 1:                                 // 30 min timeout with LCD, 1 min without
426
-          did_state = queue.enqueue_one_P(PSTR("M0Q1S" TERN(HAS_LCD_MENU, "1800", "60")));
427
-          break;
428
-      #endif
425
+      case 1:
426
+        did_state = print_job_timer.duration() < 60 || queue.enqueue_one_P(PSTR("M31"));
427
+        break;
429
 
428
 
430
-      case 2: print_job_timer.stop(); break;
429
+      case 2:
430
+        did_state = queue.enqueue_one_P(PSTR("M77"));
431
+        break;
431
 
432
 
432
       case 3:
433
       case 3:
433
-        did_state = print_job_timer.duration() < 60 || queue.enqueue_one_P(PSTR("M31"));
434
+        #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
435
+          ui.set_progress_done();
436
+        #endif
437
+        break;
438
+
439
+      case 4:                                   // Display "Click to Continue..."
440
+        #if HAS_RESUME_CONTINUE                 // 30 min timeout with LCD, 1 min without
441
+          did_state = queue.enqueue_one_P(PSTR("M0Q1S" TERN(HAS_LCD_MENU, "1800", "60")));
442
+        #endif
434
         break;
443
         break;
435
 
444
 
436
-      case 4:
445
+      case 5:
437
         #if ENABLED(POWER_LOSS_RECOVERY)
446
         #if ENABLED(POWER_LOSS_RECOVERY)
438
           recovery.purge();
447
           recovery.purge();
439
         #endif
448
         #endif
442
           planner.finish_and_disable();
451
           planner.finish_and_disable();
443
         #endif
452
         #endif
444
 
453
 
445
-        #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
446
-          ui.set_progress_done();
447
-        #endif
448
-
449
         #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
454
         #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
450
           ui.reselect_last_file();
455
           ui.reselect_last_file();
451
         #endif
456
         #endif

+ 5
- 2
Marlin/src/gcode/lcd/M0_M1.cpp View File

57
   planner.synchronize();
57
   planner.synchronize();
58
 
58
 
59
   #if HAS_LEDS_OFF_FLAG
59
   #if HAS_LEDS_OFF_FLAG
60
-    if (parser.seen('Q')) printerEventLEDs.onPrintCompleted();      // Change LED color for Print Completed
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;
61
   #endif
64
   #endif
62
 
65
 
63
   #if HAS_LCD_MENU
66
   #if HAS_LCD_MENU
64
 
67
 
65
     if (parser.string_arg)
68
     if (parser.string_arg)
66
       ui.set_status(parser.string_arg, true);
69
       ui.set_status(parser.string_arg, true);
67
-    else {
70
+    else if (!seenQ) {
68
       LCD_MESSAGEPGM(MSG_USERWAIT);
71
       LCD_MESSAGEPGM(MSG_USERWAIT);
69
       #if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
72
       #if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
70
         ui.reset_progress_bar_timeout();
73
         ui.reset_progress_bar_timeout();

Loading…
Cancel
Save