Skip to content

Commit

Permalink
Handle timing for ledStripUpdate task
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveCEvans committed Apr 12, 2021
1 parent 025ee87 commit 14236be
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main/io/ledstrip.c
Expand Up @@ -68,6 +68,8 @@

#include "rx/rx.h"

#include "scheduler/scheduler.h"

#include "sensors/acceleration.h"
#include "sensors/barometer.h"
#include "sensors/battery.h"
Expand Down Expand Up @@ -1063,8 +1065,11 @@ static void applyStatusProfile(timeUs_t now) {
}
}

if (!timActive)
if (!timActive) {
// Call ignoreTaskTime() unless data is being processed
ignoreTaskTime();
return; // no change this update, keep old state
}

applyLedFixedLayers();
for (timId_e timId = 0; timId < ARRAYLEN(layerTable); timId++) {
Expand Down Expand Up @@ -1248,6 +1253,8 @@ void ledStripUpdate(timeUs_t currentTimeUs)
#endif

if (!isWS2811LedStripReady()) {
// Call ignoreTaskTime() unless data is being processed
ignoreTaskTime();
return;
}

Expand All @@ -1274,6 +1281,9 @@ void ledStripUpdate(timeUs_t currentTimeUs)
default:
break;
}
} else {
// Call ignoreTaskTime() unless data is being processed
ignoreTaskTime();
}
}

Expand Down

0 comments on commit 14236be

Please sign in to comment.