瀏覽代碼

Prevent #div0 error (#20183)

Victor Oliveira 3 年之前
父節點
當前提交
26ac992242
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 1 行新增0 行删除
  1. 1
    0
      Marlin/src/feature/leds/printer_event_leds.cpp

+ 1
- 0
Marlin/src/feature/leds/printer_event_leds.cpp 查看文件

@@ -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…
取消
儲存