Browse Source

Fix Progress / Remaining display on DOGM (#16005)

Robby Candra 5 years ago
parent
commit
fc9f8d27eb
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      Marlin/src/lcd/dogm/status_screen_DOGM.cpp

+ 2
- 2
Marlin/src/lcd/dogm/status_screen_DOGM.cpp View File

353
     #if ENABLED(DOGM_SD_PERCENT)
353
     #if ENABLED(DOGM_SD_PERCENT)
354
       static char progress_string[5];
354
       static char progress_string[5];
355
     #endif
355
     #endif
356
-    static uint8_t lastElapsed = 0, lastProgress = 0;
356
+    static uint8_t lastElapsed = 0xFF, lastProgress = 0xFF;
357
     static u8g_uint_t elapsed_x_pos = 0, progress_bar_solid_width = 0;
357
     static u8g_uint_t elapsed_x_pos = 0, progress_bar_solid_width = 0;
358
     static char elapsed_string[16];
358
     static char elapsed_string[16];
359
     #if ENABLED(SHOW_REMAINING_TIME)
359
     #if ENABLED(SHOW_REMAINING_TIME)
460
                 + get_remaining_time()
460
                 + get_remaining_time()
461
               #endif
461
               #endif
462
             );
462
             );
463
-            if (!timeval) timeval = elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress;
463
+            if (!timeval && progress > 0) timeval = elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress;
464
             if (!timeval) {
464
             if (!timeval) {
465
               estimation_string[0] = '\0';
465
               estimation_string[0] = '\0';
466
               estimation_x_pos = _SD_INFO_X(0);
466
               estimation_x_pos = _SD_INFO_X(0);

Loading…
Cancel
Save