瀏覽代碼

Fix reseting CHDK pin to LOW

chdkActive was set to false regardless of (millis() - chdkHigh) being bigger than the CHDK_DELAY or not. So if (millis() - chdkHigh) wasn't bigger than the delay the first time, the CHDK would never be set back to LOW.

Also, don't return from the function, as there might be other stuff to do, after the CHDK check.
Florian Baumann 11 年之前
父節點
當前提交
5908fd5cec
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1
    2
      Marlin/Marlin_main.cpp

+ 1
- 2
Marlin/Marlin_main.cpp 查看文件

@@ -3516,10 +3516,9 @@ void manage_inactivity()
3516 3516
   }
3517 3517
   
3518 3518
   #ifdef CHDK //Check if pin should be set to LOW after M240 set it to HIGH
3519
-    if (chdkActive)
3519
+    if (chdkActive && (millis() - chdkHigh > CHDK_DELAY))
3520 3520
     {
3521 3521
       chdkActive = false;
3522
-      if (millis()-chdkHigh < CHDK_DELAY) return;
3523 3522
       WRITE(CHDK, LOW);
3524 3523
     }
3525 3524
   #endif

Loading…
取消
儲存