|
@@ -340,20 +340,20 @@ void MarlinUI::draw_status_screen() {
|
340
|
340
|
#define _SD_DURATION_X(len) (LCD_PIXEL_WIDTH - (len) * (MENU_FONT_WIDTH))
|
341
|
341
|
#endif
|
342
|
342
|
|
343
|
|
- static uint8_t progress_bar_solid_width = 0, lastProgress = 0;
|
344
|
343
|
#if ENABLED(DOGM_SD_PERCENT)
|
345
|
344
|
static char progress_string[5];
|
346
|
345
|
#endif
|
347
|
|
- static uint8_t lastElapsed = 0, elapsed_x_pos = 0;
|
|
346
|
+ static uint8_t lastElapsed = 0, lastProgress = 0;
|
|
347
|
+ static u8g_uint_t elapsed_x_pos = 0, progress_bar_solid_width = 0;
|
348
|
348
|
static char elapsed_string[16];
|
349
|
349
|
#if ENABLED(SHOW_REMAINING_TIME)
|
350
|
|
- static uint8_t estimation_x_pos = 0;
|
|
350
|
+ static u8g_uint_t estimation_x_pos = 0;
|
351
|
351
|
static char estimation_string[10];
|
352
|
352
|
#if ENABLED(DOGM_SD_PERCENT) && ENABLED(ROTATE_PROGRESS_DISPLAY)
|
353
|
353
|
#define PROGRESS_TIME_PREFIX "PROG"
|
354
|
354
|
#define ELAPSED_TIME_PREFIX "ELAP"
|
355
|
355
|
#define SHOW_REMAINING_TIME_PREFIX "REM"
|
356
|
|
- static uint8_t progress_x_pos = 0;
|
|
356
|
+ static u8g_uint_t progress_x_pos = 0;
|
357
|
357
|
static uint8_t progress_state = 0;
|
358
|
358
|
static bool prev_blink = 0;
|
359
|
359
|
#else
|
|
@@ -397,19 +397,26 @@ void MarlinUI::draw_status_screen() {
|
397
|
397
|
;
|
398
|
398
|
duration_t elapsed = print_job_timer.duration();
|
399
|
399
|
const uint8_t p = progress & 0xFF, ev = elapsed.value & 0xFF;
|
400
|
|
- if (progress > 1 && p != lastProgress) {
|
|
400
|
+ if (progress > 1 || p != lastProgress) {
|
401
|
401
|
lastProgress = p;
|
402
|
402
|
|
403
|
|
- progress_bar_solid_width = uint8_t((PROGRESS_BAR_WIDTH - 2) * progress / (PROGRESS_SCALE) * 0.01f);
|
|
403
|
+ progress_bar_solid_width = u8g_uint_t((PROGRESS_BAR_WIDTH - 2) * progress / (PROGRESS_SCALE) * 0.01f);
|
404
|
404
|
|
405
|
405
|
#if ENABLED(DOGM_SD_PERCENT)
|
406
|
|
- strcpy(progress_string, (
|
407
|
|
- #if ENABLED(PRINT_PROGRESS_SHOW_DECIMALS)
|
408
|
|
- permyriadtostr4(progress)
|
409
|
|
- #else
|
410
|
|
- ui8tostr3(progress / (PROGRESS_SCALE))
|
411
|
|
- #endif
|
412
|
|
- ));
|
|
406
|
+ if (progress == 0) {
|
|
407
|
+ progress_string[0] = '\0';
|
|
408
|
+ estimation_string[0] = '\0';
|
|
409
|
+ estimation_x_pos = _PROGRESS_CENTER_X(0);
|
|
410
|
+ }
|
|
411
|
+ else {
|
|
412
|
+ strcpy(progress_string, (
|
|
413
|
+ #if ENABLED(PRINT_PROGRESS_SHOW_DECIMALS)
|
|
414
|
+ permyriadtostr4(progress)
|
|
415
|
+ #else
|
|
416
|
+ ui8tostr3(progress / (PROGRESS_SCALE))
|
|
417
|
+ #endif
|
|
418
|
+ ));
|
|
419
|
+ }
|
413
|
420
|
#if ENABLED(SHOW_REMAINING_TIME) && ENABLED(ROTATE_PROGRESS_DISPLAY) // Tristate progress display mode
|
414
|
421
|
progress_x_pos = _SD_DURATION_X(strlen(progress_string)+1);
|
415
|
422
|
#endif
|