Skip to content

Commit

Permalink
Optimize WS2812FX::service()
Browse files Browse the repository at this point in the history
  • Loading branch information
TripleWhy committed Feb 12, 2025
1 parent 132c87f commit 91a7e7d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions wled00/FX_fcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1404,6 +1404,8 @@ void WS2812FX::finalizeInit() {
deserializeMap(); // (re)load default ledmap (will also setUpMatrix() if ledmap does not exist)
}

#pragma GCC push_options
#pragma GCC optimize ("O3")
void WS2812FX::service() {
unsigned long nowUp = millis(); // Be aware, millis() rolls over every 49 days
now = nowUp + timebase;
Expand Down Expand Up @@ -1568,6 +1570,7 @@ void WS2812FX::service() {
if ((_targetFps != FPS_UNLIMITED) && (millis() - nowUp > _frametime)) DEBUG_PRINTF_P(PSTR("Slow strip %u/%d.\n"), (unsigned)(millis()-nowUp), (int)_frametime);
#endif
}
#pragma GCC pop_options

void IRAM_ATTR WS2812FX::setPixelColor(unsigned i, uint32_t col) const {
i = getMappedPixelIndex(i);
Expand Down

0 comments on commit 91a7e7d

Please sign in to comment.