Pārlūkot izejas kodu

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 gadus atpakaļ
vecāks
revīzija
5908fd5cec
1 mainītis faili ar 1 papildinājumiem un 2 dzēšanām
  1. 1
    2
      Marlin/Marlin_main.cpp

+ 1
- 2
Marlin/Marlin_main.cpp Parādīt failu

3516
   }
3516
   }
3517
   
3517
   
3518
   #ifdef CHDK //Check if pin should be set to LOW after M240 set it to HIGH
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
       chdkActive = false;
3521
       chdkActive = false;
3522
-      if (millis()-chdkHigh < CHDK_DELAY) return;
3523
       WRITE(CHDK, LOW);
3522
       WRITE(CHDK, LOW);
3524
     }
3523
     }
3525
   #endif
3524
   #endif

Notiek ielāde…
Atcelt
Saglabāt