Browse Source

Fix remaining time divide-by-zero (#21080)

ellensp 3 years ago
parent
commit
35e9c131d6
No account linked to committer's email address
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      Marlin/src/lcd/marlinui.h

+ 1
- 1
Marlin/src/lcd/marlinui.h View File

@@ -248,7 +248,7 @@ public:
248 248
         static inline uint32_t _calculated_remaining_time() {
249 249
           const duration_t elapsed = print_job_timer.duration();
250 250
           const progress_t progress = _get_progress();
251
-          return elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress;
251
+          return progress ? elapsed.value * (100 * (PROGRESS_SCALE) - progress) / progress : 0;
252 252
         }
253 253
         #if ENABLED(USE_M73_REMAINING_TIME)
254 254
           static uint32_t remaining_time;

Loading…
Cancel
Save