From fdc43e0a2b966e3ecce05f3868022b774024f1c9 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Fri, 3 Jan 2025 17:45:01 +0100 Subject: [PATCH] Update usermod_PIR_sensor_switch.h - avoid starvation due to strip.isupdating() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Another instance of the "if (strip.isupdating()) return;" problem that we inherited from upstream 🙄 --- usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h b/usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h index 1bf7b0d1..a91b396e 100644 --- a/usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h +++ b/usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h @@ -294,7 +294,8 @@ public: void loop() { // only check sensors 4x/s - if (!enabled || millis() - lastLoop < 250 || strip.isUpdating()) return; + if (!enabled || millis() - lastLoop < 250) return; + if (strip.isUpdating() && (millis() - lastLoop < 250)) return; // WLEDMM be nice, but not too nice lastLoop = millis(); if (!updatePIRsensorState()) {