Kaynağa Gözat

Prevent #div0 error (#20183)

Victor Oliveira 4 yıl önce
ebeveyn
işleme
26ac992242
No account linked to committer's email address

+ 1
- 0
Marlin/src/feature/leds/printer_event_leds.cpp Dosyayı Görüntüle

@@ -41,6 +41,7 @@ PrinterEventLEDs printerEventLEDs;
41 41
   uint8_t PrinterEventLEDs::old_intensity = 0;
42 42
 
43 43
   inline uint8_t pel_intensity(const float &start, const float &current, const float &target) {
44
+    if (uint16_t(start) == uint16_t(target)) return 255;
44 45
     return (uint8_t)map(constrain(current, start, target), start, target, 0.f, 255.f);
45 46
   }
46 47
 

Loading…
İptal
Kaydet