mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-29 06:46:42 +00:00
Prevent #div0 error (#20183)
This commit is contained in:
parent
8c4a06d855
commit
26ac992242
@ -41,6 +41,7 @@ PrinterEventLEDs printerEventLEDs;
|
||||
uint8_t PrinterEventLEDs::old_intensity = 0;
|
||||
|
||||
inline uint8_t pel_intensity(const float &start, const float ¤t, const float &target) {
|
||||
if (uint16_t(start) == uint16_t(target)) return 255;
|
||||
return (uint8_t)map(constrain(current, start, target), start, target, 0.f, 255.f);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user