Browse Source

Add LCD_SET_PROGRESS_MANUALLY

Scott Lahteine 6 years ago
parent
commit
5c4f3e0107
36 changed files with 207 additions and 31 deletions
  1. 3
    0
      Marlin/Configuration_adv.h
  2. 3
    0
      Marlin/src/config/default/Configuration_adv.h
  3. 3
    0
      Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h
  4. 3
    0
      Marlin/src/config/examples/Anet/A6/Configuration_adv.h
  5. 3
    0
      Marlin/src/config/examples/Anet/A8/Configuration_adv.h
  6. 3
    0
      Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h
  7. 3
    0
      Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h
  8. 3
    0
      Marlin/src/config/examples/Cartesio/Configuration_adv.h
  9. 3
    0
      Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h
  10. 3
    0
      Marlin/src/config/examples/Felix/Configuration_adv.h
  11. 3
    0
      Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h
  12. 3
    0
      Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h
  13. 3
    0
      Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h
  14. 3
    0
      Marlin/src/config/examples/RigidBot/Configuration_adv.h
  15. 3
    0
      Marlin/src/config/examples/SCARA/Configuration_adv.h
  16. 3
    0
      Marlin/src/config/examples/Sanguinololu/Configuration_adv.h
  17. 3
    0
      Marlin/src/config/examples/TinyBoy2/Configuration_adv.h
  18. 3
    0
      Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h
  19. 3
    0
      Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h
  20. 3
    0
      Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h
  21. 3
    0
      Marlin/src/config/examples/delta/generic/Configuration_adv.h
  22. 3
    0
      Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h
  23. 3
    0
      Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h
  24. 3
    0
      Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h
  25. 3
    0
      Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h
  26. 3
    0
      Marlin/src/config/examples/makibox/Configuration_adv.h
  27. 3
    0
      Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h
  28. 3
    0
      Marlin/src/config/examples/wt150/Configuration_adv.h
  29. 4
    0
      Marlin/src/gcode/gcode.cpp
  30. 4
    0
      Marlin/src/gcode/gcode.h
  31. 7
    0
      Marlin/src/gcode/host/M115.cpp
  32. 48
    0
      Marlin/src/gcode/lcd/M73.cpp
  33. 41
    21
      Marlin/src/lcd/ultralcd.cpp
  34. 4
    0
      Marlin/src/lcd/ultralcd.h
  35. 8
    4
      Marlin/src/lcd/ultralcd_impl_DOGM.h
  36. 7
    6
      Marlin/src/lcd/ultralcd_impl_HD44780.h

+ 3
- 0
Marlin/Configuration_adv.h View File

@@ -549,6 +549,9 @@
549 549
     //#define LCD_PROGRESS_BAR_TEST
550 550
   #endif
551 551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552 555
   // This allows hosts to request long names for files and folders with M33
553 556
   //#define LONG_FILENAME_HOST_SUPPORT
554 557
 

+ 3
- 0
Marlin/src/config/default/Configuration_adv.h View File

@@ -549,6 +549,9 @@
549 549
     //#define LCD_PROGRESS_BAR_TEST
550 550
   #endif
551 551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552 555
   // This allows hosts to request long names for files and folders with M33
553 556
   //#define LONG_FILENAME_HOST_SUPPORT
554 557
 

+ 3
- 0
Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h View File

@@ -549,6 +549,9 @@
549 549
     //#define LCD_PROGRESS_BAR_TEST
550 550
   #endif
551 551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552 555
   // This allows hosts to request long names for files and folders with M33
553 556
   //#define LONG_FILENAME_HOST_SUPPORT
554 557
 

+ 3
- 0
Marlin/src/config/examples/Anet/A6/Configuration_adv.h View File

@@ -549,6 +549,9 @@
549 549
     //#define LCD_PROGRESS_BAR_TEST
550 550
   #endif
551 551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552 555
   // This allows hosts to request long names for files and folders with M33
553 556
   //#define LONG_FILENAME_HOST_SUPPORT
554 557
 

+ 3
- 0
Marlin/src/config/examples/Anet/A8/Configuration_adv.h View File

@@ -549,6 +549,9 @@
549 549
     //#define LCD_PROGRESS_BAR_TEST
550 550
   #endif
551 551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552 555
   // This allows hosts to request long names for files and folders with M33
553 556
   //#define LONG_FILENAME_HOST_SUPPORT
554 557
 

+ 3
- 0
Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h View File

@@ -549,6 +549,9 @@
549 549
     //#define LCD_PROGRESS_BAR_TEST
550 550
   #endif
551 551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552 555
   // This allows hosts to request long names for files and folders with M33
553 556
   //#define LONG_FILENAME_HOST_SUPPORT
554 557
 

+ 3
- 0
Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h View File

@@ -549,6 +549,9 @@
549 549
     //#define LCD_PROGRESS_BAR_TEST
550 550
   #endif
551 551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552 555
   // This allows hosts to request long names for files and folders with M33
553 556
   //#define LONG_FILENAME_HOST_SUPPORT
554 557
 

+ 3
- 0
Marlin/src/config/examples/Cartesio/Configuration_adv.h View File

@@ -549,6 +549,9 @@
549 549
     //#define LCD_PROGRESS_BAR_TEST
550 550
   #endif
551 551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552 555
   // This allows hosts to request long names for files and folders with M33
553 556
   //#define LONG_FILENAME_HOST_SUPPORT
554 557
 

+ 3
- 0
Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h View File

@@ -549,6 +549,9 @@
549 549
     //#define LCD_PROGRESS_BAR_TEST
550 550
   #endif
551 551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552 555
   // This allows hosts to request long names for files and folders with M33
553 556
   //#define LONG_FILENAME_HOST_SUPPORT
554 557
 

+ 3
- 0
Marlin/src/config/examples/Felix/Configuration_adv.h View File

@@ -549,6 +549,9 @@
549 549
     //#define LCD_PROGRESS_BAR_TEST
550 550
   #endif
551 551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552 555
   // This allows hosts to request long names for files and folders with M33
553 556
   //#define LONG_FILENAME_HOST_SUPPORT
554 557
 

+ 3
- 0
Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h View File

@@ -549,6 +549,9 @@
549 549
     //#define LCD_PROGRESS_BAR_TEST
550 550
   #endif
551 551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552 555
   // This allows hosts to request long names for files and folders with M33
553 556
   //#define LONG_FILENAME_HOST_SUPPORT
554 557
 

+ 3
- 0
Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h View File

@@ -549,6 +549,9 @@
549 549
     //#define LCD_PROGRESS_BAR_TEST
550 550
   #endif
551 551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552 555
   // This allows hosts to request long names for files and folders with M33
553 556
   //#define LONG_FILENAME_HOST_SUPPORT
554 557
 

+ 3
- 0
Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h View File

@@ -549,6 +549,9 @@
549 549
     //#define LCD_PROGRESS_BAR_TEST
550 550
   #endif
551 551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552 555
   // This allows hosts to request long names for files and folders with M33
553 556
   //#define LONG_FILENAME_HOST_SUPPORT
554 557
 

+ 3
- 0
Marlin/src/config/examples/RigidBot/Configuration_adv.h View File

@@ -549,6 +549,9 @@
549 549
     //#define LCD_PROGRESS_BAR_TEST
550 550
   #endif
551 551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552 555
   // This allows hosts to request long names for files and folders with M33
553 556
   //#define LONG_FILENAME_HOST_SUPPORT
554 557
 

+ 3
- 0
Marlin/src/config/examples/SCARA/Configuration_adv.h View File

@@ -549,6 +549,9 @@
549 549
     //#define LCD_PROGRESS_BAR_TEST
550 550
   #endif
551 551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552 555
   // This allows hosts to request long names for files and folders with M33
553 556
   //#define LONG_FILENAME_HOST_SUPPORT
554 557
 

+ 3
- 0
Marlin/src/config/examples/Sanguinololu/Configuration_adv.h View File

@@ -538,6 +538,9 @@
538 538
     //#define LCD_PROGRESS_BAR_TEST
539 539
   #endif
540 540
 
541
+  // Add an 'M73' G-code to set the current percentage
542
+  //#define LCD_SET_PROGRESS_MANUALLY
543
+
541 544
   // This allows hosts to request long names for files and folders with M33
542 545
   //#define LONG_FILENAME_HOST_SUPPORT
543 546
 

+ 3
- 0
Marlin/src/config/examples/TinyBoy2/Configuration_adv.h View File

@@ -549,6 +549,9 @@
549 549
     //#define LCD_PROGRESS_BAR_TEST
550 550
   #endif
551 551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552 555
   // This allows hosts to request long names for files and folders with M33
553 556
   //#define LONG_FILENAME_HOST_SUPPORT
554 557
 

+ 3
- 0
Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h View File

@@ -549,6 +549,9 @@
549 549
     //#define LCD_PROGRESS_BAR_TEST
550 550
   #endif
551 551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552 555
   // This allows hosts to request long names for files and folders with M33
553 556
   //#define LONG_FILENAME_HOST_SUPPORT
554 557
 

+ 3
- 0
Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h View File

@@ -551,6 +551,9 @@
551 551
     //#define LCD_PROGRESS_BAR_TEST
552 552
   #endif
553 553
 
554
+  // Add an 'M73' G-code to set the current percentage
555
+  //#define LCD_SET_PROGRESS_MANUALLY
556
+
554 557
   // This allows hosts to request long names for files and folders with M33
555 558
   //#define LONG_FILENAME_HOST_SUPPORT
556 559
 

+ 3
- 0
Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h View File

@@ -551,6 +551,9 @@
551 551
     //#define LCD_PROGRESS_BAR_TEST
552 552
   #endif
553 553
 
554
+  // Add an 'M73' G-code to set the current percentage
555
+  //#define LCD_SET_PROGRESS_MANUALLY
556
+
554 557
   // This allows hosts to request long names for files and folders with M33
555 558
   //#define LONG_FILENAME_HOST_SUPPORT
556 559
 

+ 3
- 0
Marlin/src/config/examples/delta/generic/Configuration_adv.h View File

@@ -551,6 +551,9 @@
551 551
     //#define LCD_PROGRESS_BAR_TEST
552 552
   #endif
553 553
 
554
+  // Add an 'M73' G-code to set the current percentage
555
+  //#define LCD_SET_PROGRESS_MANUALLY
556
+
554 557
   // This allows hosts to request long names for files and folders with M33
555 558
   //#define LONG_FILENAME_HOST_SUPPORT
556 559
 

+ 3
- 0
Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h View File

@@ -551,6 +551,9 @@
551 551
     //#define LCD_PROGRESS_BAR_TEST
552 552
   #endif
553 553
 
554
+  // Add an 'M73' G-code to set the current percentage
555
+  //#define LCD_SET_PROGRESS_MANUALLY
556
+
554 557
   // This allows hosts to request long names for files and folders with M33
555 558
   //#define LONG_FILENAME_HOST_SUPPORT
556 559
 

+ 3
- 0
Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h View File

@@ -556,6 +556,9 @@
556 556
     //#define LCD_PROGRESS_BAR_TEST
557 557
   #endif
558 558
 
559
+  // Add an 'M73' G-code to set the current percentage
560
+  //#define LCD_SET_PROGRESS_MANUALLY
561
+
559 562
   // This allows hosts to request long names for files and folders with M33
560 563
   //#define LONG_FILENAME_HOST_SUPPORT
561 564
 

+ 3
- 0
Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h View File

@@ -551,6 +551,9 @@
551 551
     //#define LCD_PROGRESS_BAR_TEST
552 552
   #endif
553 553
 
554
+  // Add an 'M73' G-code to set the current percentage
555
+  //#define LCD_SET_PROGRESS_MANUALLY
556
+
554 557
   // This allows hosts to request long names for files and folders with M33
555 558
   //#define LONG_FILENAME_HOST_SUPPORT
556 559
 

+ 3
- 0
Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h View File

@@ -549,6 +549,9 @@
549 549
     //#define LCD_PROGRESS_BAR_TEST
550 550
   #endif
551 551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552 555
   // This allows hosts to request long names for files and folders with M33
553 556
   //#define LONG_FILENAME_HOST_SUPPORT
554 557
 

+ 3
- 0
Marlin/src/config/examples/makibox/Configuration_adv.h View File

@@ -549,6 +549,9 @@
549 549
     //#define LCD_PROGRESS_BAR_TEST
550 550
   #endif
551 551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552 555
   // This allows hosts to request long names for files and folders with M33
553 556
   //#define LONG_FILENAME_HOST_SUPPORT
554 557
 

+ 3
- 0
Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h View File

@@ -549,6 +549,9 @@
549 549
     //#define LCD_PROGRESS_BAR_TEST
550 550
   #endif
551 551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552 555
   // This allows hosts to request long names for files and folders with M33
553 556
   //#define LONG_FILENAME_HOST_SUPPORT
554 557
 

+ 3
- 0
Marlin/src/config/examples/wt150/Configuration_adv.h View File

@@ -549,6 +549,9 @@
549 549
     //#define LCD_PROGRESS_BAR_TEST
550 550
   #endif
551 551
 
552
+  // Add an 'M73' G-code to set the current percentage
553
+  //#define LCD_SET_PROGRESS_MANUALLY
554
+
552 555
   // This allows hosts to request long names for files and folders with M33
553 556
   //#define LONG_FILENAME_HOST_SUPPORT
554 557
 

+ 4
- 0
Marlin/src/gcode/gcode.cpp View File

@@ -354,6 +354,10 @@ void GcodeSuite::process_next_command() {
354 354
         case 49: M49(); break;    // M49: Turn on or off G26 debug flag for verbose output
355 355
       #endif
356 356
 
357
+      #if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY)
358
+        case 73: M73(); break;    // M73: Set progress percentage (for display on LCD)
359
+      #endif
360
+
357 361
       case 75: M75(); break;      // M75: Start print timer
358 362
       case 76: M76(); break;      // M76: Pause print timer
359 363
       case 77: M77(); break;      // M77: Stop print timer

+ 4
- 0
Marlin/src/gcode/gcode.h View File

@@ -437,6 +437,10 @@ private:
437 437
     static void M49();
438 438
   #endif
439 439
 
440
+  #if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY)
441
+    static void M73();
442
+  #endif
443
+
440 444
   static void M75();
441 445
   static void M76();
442 446
   static void M77();

+ 7
- 0
Marlin/src/gcode/host/M115.cpp View File

@@ -72,6 +72,13 @@ void GcodeSuite::M115() {
72 72
       SERIAL_PROTOCOLLNPGM("Cap:LEVELING_DATA:0");
73 73
     #endif
74 74
 
75
+    // BUILD_PERCENT (M73)
76
+    #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
77
+      SERIAL_PROTOCOLLNPGM("Cap:BUILD_PERCENT:1");
78
+    #else
79
+      SERIAL_PROTOCOLLNPGM("Cap:BUILD_PERCENT:0");
80
+    #endif
81
+
75 82
     // SOFTWARE_POWER (M80, M81)
76 83
     #if HAS_POWER_SWITCH
77 84
       SERIAL_PROTOCOLLNPGM("Cap:SOFTWARE_POWER:1");

+ 48
- 0
Marlin/src/gcode/lcd/M73.cpp View File

@@ -0,0 +1,48 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 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(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY)
26
+
27
+#include "../gcode.h"
28
+#include "../../module/parser.h"
29
+#include "../../lcd/ultralcd.h"
30
+#include "../../sd/cardreader.h"
31
+
32
+/**
33
+ * M73: Set percentage complete (for display on LCD)
34
+ *
35
+ * Example:
36
+ *   M73 P25 ; Set progress to 25%
37
+ *
38
+ * Notes:
39
+ *   This has no effect during an SD print job
40
+ */
41
+void GcodeSuite::M73() {
42
+  if (!IS_SD_PRINTING && parser.seen('P')) {
43
+    progress_bar_percent = parser.value_byte();
44
+    NOMORE(progress_bar_percent, 100);
45
+  }
46
+}
47
+
48
+#endif // ULTRA_LCD && LCD_SET_PROGRESS_MANUALLY

+ 41
- 21
Marlin/src/lcd/ultralcd.cpp View File

@@ -83,6 +83,10 @@ char lcd_status_message[3 * (LCD_WIDTH) + 1] = WELCOME_MSG; // worst case is kan
83 83
   uint8_t status_scroll_pos = 0;
84 84
 #endif
85 85
 
86
+#if ENABLED(LCD_SET_PROGRESS_MANUALLY)
87
+  uint8_t progress_bar_percent;
88
+#endif
89
+
86 90
 #if ENABLED(DOGLCD)
87 91
   #include "ultralcd_impl_DOGM.h"
88 92
   #include <U8glib.h>
@@ -604,36 +608,52 @@ void lcd_status_screen() {
604 608
   #endif
605 609
 
606 610
   #if ENABLED(LCD_PROGRESS_BAR)
611
+
612
+    //
613
+    // HD44780 implements the following message blinking and
614
+    // message expiration because Status Line and Progress Bar
615
+    // share the same line on the display.
616
+    //
617
+
618
+    // Set current percentage from SD when actively printing
619
+    #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
620
+      if (IS_SD_PRINTING)
621
+        progress_bar_percent = card.percentDone();
622
+    #endif
623
+
607 624
     millis_t ms = millis();
625
+
626
+    // If the message will blink rather than expire...
608 627
     #if DISABLED(PROGRESS_MSG_ONCE)
609
-      if (ELAPSED(ms, progress_bar_ms + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME)) {
628
+      if (ELAPSED(ms, progress_bar_ms + PROGRESS_BAR_MSG_TIME + PROGRESS_BAR_BAR_TIME))
610 629
         progress_bar_ms = ms;
611
-      }
612 630
     #endif
631
+
613 632
     #if PROGRESS_MSG_EXPIRE > 0
633
+
614 634
       // Handle message expire
615 635
       if (expire_status_ms > 0) {
616
-        #if ENABLED(SDSUPPORT)
617
-          if (card.isFileOpen()) {
618
-            // Expire the message when printing is active
619
-            if (IS_SD_PRINTING) {
620
-              if (ELAPSED(ms, expire_status_ms)) {
621
-                lcd_status_message[0] = '\0';
622
-                expire_status_ms = 0;
623
-              }
624
-            }
625
-            else {
626
-              expire_status_ms += LCD_UPDATE_INTERVAL;
627
-            }
628
-          }
629
-          else {
636
+
637
+        #if DISABLED(LCD_SET_PROGRESS_MANUALLY)
638
+          const uint8_t progress_bar_percent = card.percentDone();
639
+        #endif
640
+
641
+        // Expire the message if a job is active and the bar has ticks
642
+        if (progress_bar_percent > 2 && !print_job_timer.isPaused()) {
643
+          if (ELAPSED(ms, expire_status_ms)) {
644
+            lcd_status_message[0] = '\0';
630 645
             expire_status_ms = 0;
631 646
           }
632
-        #else
633
-          expire_status_ms = 0;
634
-        #endif // SDSUPPORT
647
+        }
648
+        else {
649
+          // Defer message expiration before bar appears
650
+          // and during any pause (not just SD)
651
+          expire_status_ms += LCD_UPDATE_INTERVAL;
652
+        }
635 653
       }
636
-    #endif
654
+
655
+    #endif // PROGRESS_MSG_EXPIRE
656
+
637 657
   #endif // LCD_PROGRESS_BAR
638 658
 
639 659
   #if ENABLED(ULTIPANEL)
@@ -2860,7 +2880,7 @@ void kill_screen(const char* lcd_msg) {
2860 2880
             #if ENABLED(MAX_SOFTWARE_ENDSTOP_Z)
2861 2881
               max = soft_endstop_max[Z_AXIS];
2862 2882
             #endif
2863
-            break;
2883
+          default: break;
2864 2884
         }
2865 2885
       #endif // MIN_SOFTWARE_ENDSTOPS || MAX_SOFTWARE_ENDSTOPS
2866 2886
 

+ 4
- 0
Marlin/src/lcd/ultralcd.h View File

@@ -63,6 +63,10 @@
63 63
     void dontExpireStatus();
64 64
   #endif
65 65
 
66
+  #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
67
+    extern uint8_t progress_bar_percent;
68
+  #endif
69
+
66 70
   #if ENABLED(ADC_KEYPAD)
67 71
     uint8_t get_ADC_keyValue();
68 72
   #endif

+ 8
- 4
Marlin/src/lcd/ultralcd_impl_DOGM.h View File

@@ -536,7 +536,7 @@ static void lcd_implementation_status_screen() {
536 536
     // SD Card Symbol
537 537
     //
538 538
 
539
-    if (PAGE_CONTAINS(42 - (TALL_FONT_CORRECTION), 51 - (TALL_FONT_CORRECTION))) {
539
+    if (card.isFileOpen() && PAGE_CONTAINS(42 - (TALL_FONT_CORRECTION), 51 - (TALL_FONT_CORRECTION))) {
540 540
       // Upper box
541 541
       u8g.drawBox(42, 42 - (TALL_FONT_CORRECTION), 8, 7);     // 42-48 (or 41-47)
542 542
       // Right edge
@@ -560,7 +560,11 @@ static void lcd_implementation_status_screen() {
560 560
         PROGRESS_BAR_WIDTH, 4 - (TALL_FONT_CORRECTION)
561 561
       );
562 562
 
563
-    if (IS_SD_PRINTING) {
563
+    #if DISABLED(LCD_SET_PROGRESS_MANUALLY)
564
+      const uint8_t progress_bar_percent = card.percentDone();
565
+    #endif
566
+
567
+    if (progress_bar_percent > 1) {
564 568
 
565 569
       //
566 570
       // Progress bar solid part
@@ -569,7 +573,7 @@ static void lcd_implementation_status_screen() {
569 573
       if (PAGE_CONTAINS(50, 51 - (TALL_FONT_CORRECTION)))     // 50-51 (or just 50)
570 574
         u8g.drawBox(
571 575
           PROGRESS_BAR_X + 1, 50,
572
-          (uint16_t)((PROGRESS_BAR_WIDTH - 2) * card.percentDone() * 0.01), 2 - (TALL_FONT_CORRECTION)
576
+          (uint16_t)((PROGRESS_BAR_WIDTH - 2) * progress_bar_percent * 0.01), 2 - (TALL_FONT_CORRECTION)
573 577
         );
574 578
 
575 579
       //
@@ -580,7 +584,7 @@ static void lcd_implementation_status_screen() {
580 584
         if (PAGE_CONTAINS(41, 48)) {
581 585
           // Percent complete
582 586
           u8g.setPrintPos(55, 48);
583
-          u8g.print(itostr3(card.percentDone()));
587
+          u8g.print(itostr3(progress_bar_percent));
584 588
           u8g.print('%');
585 589
         }
586 590
       #endif

+ 7
- 6
Marlin/src/lcd/ultralcd_impl_HD44780.h View File

@@ -203,9 +203,9 @@ extern volatile uint8_t buttons;  //an extended version of the last checked butt
203 203
 #include "utf_mapper.h"
204 204
 
205 205
 #if ENABLED(LCD_PROGRESS_BAR)
206
-  static millis_t progress_bar_ms = 0;
206
+  static millis_t progress_bar_ms = 0;     // Start millis of the current progress bar cycle
207 207
   #if PROGRESS_MSG_EXPIRE > 0
208
-    static millis_t expire_status_ms = 0;
208
+    static millis_t expire_status_ms = 0;  // millis at which to expire the status message
209 209
   #endif
210 210
   #define LCD_STR_PROGRESS  "\x03\x04\x05"
211 211
 #endif
@@ -842,12 +842,13 @@ static void lcd_implementation_status_screen() {
842 842
 
843 843
   #if ENABLED(LCD_PROGRESS_BAR)
844 844
 
845
+    #if DISABLED(LCD_SET_PROGRESS_MANUALLY)
846
+      const uint8_t progress_bar_percent = card.percentDone();
847
+    #endif
845 848
     // Draw the progress bar if the message has shown long enough
846 849
     // or if there is no message set.
847
-    if (card.isFileOpen() && (ELAPSED(millis(), progress_bar_ms + PROGRESS_BAR_MSG_TIME) || !lcd_status_message[0])) {
848
-      const uint8_t percent = card.percentDone();
849
-      if (percent) return lcd_draw_progress_bar(percent);
850
-    }
850
+    if (progress_bar_percent > 2 && (ELAPSED(millis(), progress_bar_ms + PROGRESS_BAR_MSG_TIME) || !lcd_status_message[0]))
851
+      return lcd_draw_progress_bar(progress_bar_percent);
851 852
 
852 853
   #elif ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
853 854
 

Loading…
Cancel
Save