Browse Source

Remaining Time followup (#20199)

vanilla_fb_2.0.x
ellensp 4 years ago
committed by GitHub
parent
commit
c059ea0ea0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      Marlin/src/lcd/HD44780/marlinui_HD44780.cpp

8
Marlin/src/lcd/HD44780/marlinui_HD44780.cpp

@ -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