Explorar el Código

Prevent #div0 error (#20183)

Victor Oliveira hace 3 años
padre
commit
26ac992242
No account linked to committer's email address
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1
    0
      Marlin/src/feature/leds/printer_event_leds.cpp

+ 1
- 0
Marlin/src/feature/leds/printer_event_leds.cpp Ver fichero

@@ -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…
Cancelar
Guardar