From 391ad0fe90da305348a402417babe1eceb4774b9 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Wed, 25 Apr 2018 12:09:22 +0200 Subject: [PATCH] bugfixing LED routine (not yet fixed) --- src/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 5407dc15..b8235598 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -409,17 +409,21 @@ uint64_t uptime() { #endif previousLEDState = LEDState; - blinkdone = LEDState ? true : false; + blinkdone = LEDState ? true : false; // if LED was turned on, a blink was done } }; // switchLED() void switchLEDstate() { + if (LEDInterval) // LED is blinking, wait until time elapsed, then toggle LED LEDState = ((currentMillis % LEDInterval) < LEDBlinkduration) ? LED_ON : LED_OFF; + else // check if in oneblink mode - if (!blinkdone) { // keep LED on until one blink is done + + if (!blinkdone) // keep LED on until one blink is done LEDState = (currentMillis % LEDBlinkduration) > 0 ? LED_ON : LED_OFF; + } // switchLEDstate() #endif