Remaining Time followup (#20199)

2.0.x
ellensp 4 years ago committed by Scott Lahteine
parent 15febdfe07
commit d92f69f137

@ -707,7 +707,7 @@ void MarlinUI::draw_status_message(const bool blink) {
* |01234567890123456789|
*/
inline uint8_t draw_elapsed_or_remaining_time(uint8_t timepos) {
inline uint8_t draw_elapsed_or_remaining_time(uint8_t timepos, const bool blink) {
char buffer[14];
#if ENABLED(SHOW_REMAINING_TIME)
@ -716,7 +716,7 @@ inline uint8_t draw_elapsed_or_remaining_time(uint8_t timepos) {
#if ENABLED(USE_M73_REMAINING_TIME)
duration_t remaining = get_remaining_time();
#else
uint8_t progress = get_progress_percent();
uint8_t progress = ui.get_progress_percent();
uint32_t elapsed = print_job_timer.duration();
duration_t remaining = (progress > 0) ? ((elapsed * 25600 / progress) >> 8) - elapsed : 0;
#endif
@ -874,7 +874,7 @@ void MarlinUI::draw_status_screen() {
lcd_put_u8str(i16tostr3rj(feedrate_percentage));
lcd_put_wchar('%');
const uint8_t timepos = draw_elapsed_or_remaining_time(LCD_WIDTH - 1);
const uint8_t timepos = draw_elapsed_or_remaining_time(LCD_WIDTH - 1, blink);
#if LCD_WIDTH >= 20
lcd_moveto(timepos - 7, 2);
@ -973,7 +973,7 @@ void MarlinUI::draw_status_screen() {
#else
(void)draw_elapsed_or_remaining_time(LCD_WIDTH - 4);
(void)draw_elapsed_or_remaining_time(LCD_WIDTH - 4, blink);
#endif

Loading…
Cancel
Save