Skip to content

Commit fdc43e0

Browse files
authored
Update usermod_PIR_sensor_switch.h - avoid starvation due to strip.isupdating()
Another instance of the "if (strip.isupdating()) return;" problem that we inherited from upstream 🙄
1 parent 9618d7a commit fdc43e0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ class PIRsensorSwitch : public Usermod
294294
void loop()
295295
{
296296
// only check sensors 4x/s
297-
if (!enabled || millis() - lastLoop < 250 || strip.isUpdating()) return;
297+
if (!enabled || millis() - lastLoop < 250) return;
298+
if (strip.isUpdating() && (millis() - lastLoop < 250)) return; // WLEDMM be nice, but not too nice
298299
lastLoop = millis();
299300

300301
if (!updatePIRsensorState()) {

0 commit comments

Comments
 (0)