1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-24 20:43:32 +00:00

Remaining Time followup (#20199)

This commit is contained in:
ellensp 2020-11-19 19:09:51 +13:00 committed by Scott Lahteine
parent 15febdfe07
commit d92f69f137

View File

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