Bläddra i källkod

Fix SD progress with Lite Status Screen

Co-Authored-By: Lê Hoàng <icy.lord.love.angel@gmail.com>
Scott Lahteine 6 år sedan
förälder
incheckning
a15e570d3b
1 ändrade filer med 22 tillägg och 14 borttagningar
  1. 22
    14
      Marlin/src/lcd/dogm/status_screen_lite_ST7920.h

+ 22
- 14
Marlin/src/lcd/dogm/status_screen_lite_ST7920.h Visa fil

@@ -876,24 +876,32 @@ void ST7920_Lite_Status_Screen::update_status_or_position(bool forceUpdate) {
876 876
 }
877 877
 
878 878
 void ST7920_Lite_Status_Screen::update_progress(const bool forceUpdate) {
879
-  #if DISABLED(LCD_SET_PROGRESS_MANUALLY)
880
-    uint8_t progress_bar_percent = 0;
881
-  #endif
879
+  #if ENABLED(LCD_SET_PROGRESS_MANUALLY) || ENABLED(SDSUPPORT)
882 880
 
883
-  #if ENABLED(LCD_SET_PROGRESS_MANUALLY) && ENABLED(SDSUPPORT) && (ENABLED(LCD_PROGRESS_BAR) || ENABLED(DOGLCD))
884
-    // Progress bar % comes from SD when actively printing
885
-    if (IS_SD_PRINTING) progress_bar_percent = card.percentDone();
886
-  #endif
881
+    #if DISABLED(LCD_SET_PROGRESS_MANUALLY)
882
+      uint8_t progress_bar_percent; //=0
883
+    #endif
884
+
885
+    #if ENABLED(SDSUPPORT)
886
+      // Progress bar % comes from SD when actively printing
887
+      if (IS_SD_PRINTING) progress_bar_percent = card.percentDone();
888
+    #endif
887 889
 
888
-  // Since the progress bar involves writing
889
-  // quite a few bytes to GDRAM, only do this
890
-  // when an update is actually necessary.
890
+    // Since the progress bar involves writing
891
+    // quite a few bytes to GDRAM, only do this
892
+    // when an update is actually necessary.
893
+
894
+    static uint8_t last_progress = 0;
895
+    if (!forceUpdate && last_progress == progress_bar_percent) return;
896
+    last_progress = progress_bar_percent;
897
+
898
+    draw_progress_bar(progress_bar_percent);
899
+
900
+  #else
891 901
 
892
-  static uint8_t last_progress = 0;
893
-  if (!forceUpdate && last_progress == progress_bar_percent) return;
894
-  last_progress = progress_bar_percent;
902
+    UNUSED(forceUpdate);
895 903
 
896
-  draw_progress_bar(progress_bar_percent);
904
+  #endif // LCD_SET_PROGRESS_MANUALLY || SDSUPPORT
897 905
 }
898 906
 
899 907
 void ST7920_Lite_Status_Screen::update(const bool forceUpdate) {

Laddar…
Avbryt
Spara