Skip to content

Commit

Permalink
Remaining Time followup (MarlinFirmware#20199)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellensp authored and dpreed committed Feb 5, 2021
1 parent 38e2da2 commit fa7457e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Marlin/src/lcd/HD44780/marlinui_HD44780.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit fa7457e

Please sign in to comment.