Skip to content

Commit

Permalink
Fix remaining time divide-by-zero (MarlinFirmware#21080)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellensp authored and vyacheslav-shubin committed Mar 10, 2021
1 parent 6a8d13c commit 2db5ec3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Marlin/src/lcd/marlinui.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class MarlinUI {
static inline uint32_t _calculated_remaining_time() {
const duration_t elapsed = print_job_timer.duration();
const progress_t progress = _get_progress();
return elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress;
return progress ? elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress : 0;
}
#if ENABLED(USE_M73_REMAINING_TIME)
static uint32_t remaining_time;
Expand Down

0 comments on commit 2db5ec3

Please sign in to comment.