소스 검색

Fix jumping progress bar. (#11439)

- When LCD_SET_PROGRESS_MANUALLY was disabled and an SD print was not active (i.e. the printer was idle), progress_bar_percent would read uninitialized memory from stack and cause progress bar to jump wildly.
- Also updated conditions in `#ifdef` to match `ultralcd.cpp`
Marcio Teixeira 7 년 전
부모
커밋
f2224755ad
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3
    3
      Marlin/src/lcd/dogm/status_screen_lite_ST7920.h

+ 3
- 3
Marlin/src/lcd/dogm/status_screen_lite_ST7920.h 파일 보기

@@ -877,11 +877,11 @@ void ST7920_Lite_Status_Screen::update_status_or_position(bool forceUpdate) {
877 877
 
878 878
 void ST7920_Lite_Status_Screen::update_progress(const bool forceUpdate) {
879 879
   #if DISABLED(LCD_SET_PROGRESS_MANUALLY)
880
-    uint8_t progress_bar_percent;
880
+    uint8_t progress_bar_percent = 0;
881 881
   #endif
882 882
 
883
-  // Set current percentage from SD when actively printing
884
-  #if ENABLED(SDSUPPORT)
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 885
     if (IS_SD_PRINTING) progress_bar_percent = card.percentDone();
886 886
   #endif
887 887
 

Loading…
취소
저장