Sfoglia il codice sorgente

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

ellensp 3 anni fa
parent
commit
35e9c131d6
Nessun account collegato all'indirizzo email del committer
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1
    1
      Marlin/src/lcd/marlinui.h

+ 1
- 1
Marlin/src/lcd/marlinui.h Vedi 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…
Annulla
Salva