From c79eb43347cade815656146af9c5c5b9504e93a2 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Wed, 22 Jun 2022 12:36:47 +0200 Subject: [PATCH] disabled second check for strip.isUpdating() commented out the second `strip.isUpdating()` check, because it should not be neccesary; Strip.service() is called after handleIO()/handleButton(). --- wled00/button.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/wled00/button.cpp b/wled00/button.cpp index 2f01fdab..2c433a34 100644 --- a/wled00/button.cpp +++ b/wled00/button.cpp @@ -159,12 +159,13 @@ void handleAnalog(uint8_t b) // remove noise & reduce frequency of UI updates if (abs(int(aRead) - int(oldRead[b])) <= POT_SENSITIVITY) return; // no significant change in reading - // wait until strip finishes updating (why: strip was not updating at the start of handleButton() but may have started during analogRead()?) - unsigned long wait_started = millis(); - while(strip.isUpdating() && (millis() - wait_started < STRIP_WAIT_TIME)) { - delay(1); - } - if (strip.isUpdating()) return; // give up + // Unomment the next lines if you still see flickering related to potentiometer + // This waits until strip finishes updating (why: strip was not updating at the start of handleButton() but may have started during analogRead()?) + //unsigned long wait_started = millis(); + //while(strip.isUpdating() && (millis() - wait_started < STRIP_WAIT_TIME)) { + // delay(1); + //} + //if (strip.isUpdating()) return; // give up oldRead[b] = aRead;