Skip to content

Commit

Permalink
Update usermod_PIR_sensor_switch.h - avoid starvation due to strip.is…
Browse files Browse the repository at this point in the history
…updating()

Another instance of the "if (strip.isupdating()) return;" problem that we inherited from upstream 🙄
  • Loading branch information
softhack007 authored Jan 3, 2025
1 parent 9618d7a commit fdc43e0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion usermods/PIR_sensor_switch/usermod_PIR_sensor_switch.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@ class PIRsensorSwitch : public Usermod
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()) {
Expand Down

0 comments on commit fdc43e0

Please sign in to comment.