Skip to content

Fix calling usermod overlay prior to setup - #5933

Open
willmmiles wants to merge 2 commits into
wled:mainfrom
willmmiles:overlay-too-early
Open

willmmiles wants to merge 2 commits into
wled:mainfrom
willmmiles:overlay-too-early

Conversation

@willmmiles

@willmmiles willmmiles commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Two small fixes:

  • Manually blank the output busses in beginStrip() instead of calling show(). This avoids triggering usermods and running the whole effect engine to produce what we want to be a deterministic output. It's also faster.
  • Perf: remove setShowCallback(). I believe this was meant to enable usermod overlays, at the right point in the boot sequence, but was used incorrectly. It's also no longer necessary to pay the performance penalty for doing the check and making the indirect function call.

Ref: #5920 (comment)

Summary by CodeRabbit

  • Bug Fixes
    • Improved LED strip startup handling so LEDs are cleared when no relay is configured, helping prevent unwanted lights from remaining on.
    • Updated overlay drawing behavior during LED output.
  • Changes
    • Removed the configurable pre-show callback facility.

This function is unused - no need to pay for the indirection.
If not using a relay, explicitly black out the LED data instead of
calling the rendering engine at boot.  This avoids calling
usermod overlays prior to usermod setup.
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: wled/WLED
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: bb49248
  • Layers: Repository YAML (base), Repository UI (inherited), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 32a56f96-1a29-489c-9ebe-bfd4b9ae2ebc
Commits

Reviewing files that changed from the base of the PR and between bb49248 and 83c0b4c.

Files selected for processing: 5
  • wled00/FX.h
  • wled00/FX_fcn.cpp
  • wled00/bus_manager.cpp
  • wled00/bus_manager.h
  • wled00/wled.cpp

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Recent review details
Context from checks skipped due to timeout: 28
  • GitHub Check: wled_build / Build Environments (esp32c3dev)
  • GitHub Check: wled_build / Build Environments (usermods)
  • GitHub Check: wled_build / Build Environments (esp32s3dev_4MB_qspi_hub75)
  • GitHub Check: wled_build / Build Environments (esp32dev_hub75_forum_pinout)
  • GitHub Check: wled_build / Build Environments (esp32S3_wroom2)
  • GitHub Check: wled_build / Build Environments (esp32s3_4M_qspi)
  • GitHub Check: wled_build / Build Environments (esp32s3dev_16MB_opi_hub75)
  • GitHub Check: wled_build / Build Environments (esp32s3_4M_qspi)
  • GitHub Check: wled_build / Build Environments (esp32s3dev_8MB_qspi)
  • GitHub Check: wled_build / Build Environments (esp32s3dev_16MB_opi)
  • GitHub Check: wled_build / Build Environments (lolin_s2_mini)
  • GitHub Check: wled_build / Build Environments (esp32c3dev_qio)
  • GitHub Check: wled_build / Build Environments (esp32s3dev_8MB_none)
  • GitHub Check: wled_build / Build Environments (esp32p4_16MB)
  • GitHub Check: wled_build / Build Environments (esp32c6dev_4MB)
  • GitHub Check: wled_build / Build Environments (esp32c5dev)
  • GitHub Check: wled_build / Build Environments (esp32s3dev_8MB_opi)
  • GitHub Check: wled_build / Build Environments (esp8266_2m)
  • GitHub Check: wled_build / Build Environments (esp32_eth)
  • GitHub Check: wled_build / Build Environments (esp32c5dev_8MB_qspi)
  • GitHub Check: wled_build / Build Environments (esp32_eth_V4)
  • GitHub Check: wled_build / Build Environments (esp32dev_debug)
  • GitHub Check: wled_build / Build Environments (esp8266_2m_compat)
  • GitHub Check: wled_build / Build Environments (esp32dev)
  • GitHub Check: wled_build / Build Environments (esp32_wrover)
  • GitHub Check: wled_build / Build Environments (esp32dev_V4)
  • GitHub Check: wled_build / Build Environments (nodemcuv2)
  • GitHub Check: wled_build / Build Environments (esp01_1m_full)
Additional context used
Code guidelines: 4
docs/hardening.instructions.md — configured
.github/agent-build.instructions.md — auto-discovered
AGENTS.md — configured
docs/cpp.instructions.md — configured
Path-based instructions: 5
Apply the WLED security hardening rules from docs/hardening.instructions.md, and consult docs/securecode.instructions.md when more details are needed for actionable recommendations.

CodeRabbit configuration file

Files:

  • wled00/bus_manager.cpp
  • wled00/bus_manager.h
  • wled00/FX_fcn.cpp
  • wled00/FX.h
  • wled00/wled.cpp
Follow the C++ coding conventions documented in docs/cpp.instructions.md and the general project guidelines in AGENTS.md and .github/copilot-instructions.md.

CodeRabbit configuration file

Files:

  • wled00/bus_manager.cpp
  • wled00/bus_manager.h
  • wled00/FX_fcn.cpp
  • wled00/FX.h
  • wled00/wled.cpp
Applicability reference: AGENTS.md: # AGENTS.md — WLED AI Coding Agent & AI Code Review Reference See also: `.github/copilot-instructions.md`, `.github/agent-build.instructions.md`, `docs/cpp.instructions.md`, `docs/web.in...

CodeRabbit inference engine (docs/hardening.instructions.md)

Files:

  • wled00/bus_manager.cpp
  • wled00/bus_manager.h
  • wled00/FX_fcn.cpp
  • wled00/FX.h
  • wled00/wled.cpp
Applicability reference: AGENTS.md: # AGENTS.md — WLED AI Coding Agent & AI Code Review Reference See also: `.github/copilot-instructions.md`, `.github/agent-build.instructions.md`, `docs/cpp.instructions.md`, `docs/web.instructions.md`, `d...

CodeRabbit inference engine (.github/agent-build.instructions.md)

Files:

  • wled00/bus_manager.cpp
  • wled00/bus_manager.h
  • wled00/FX_fcn.cpp
  • wled00/FX.h
  • wled00/wled.cpp
Source excerpt: Follow the existing style in the file you are editing Source excerpt: Avoid unexplained "magic numbers".

CodeRabbit inference engine (AGENTS.md)

Files:

  • wled00/bus_manager.cpp
  • wled00/bus_manager.h
  • wled00/FX_fcn.cpp
  • wled00/FX.h
  • wled00/wled.cpp
Additional comments: 5
wled00/FX_fcn.cpp: 1

1890-1891: LGTM!

wled00/bus_manager.h: 1

566-566: LGTM!

wled00/bus_manager.cpp: 1

1477-1484: LGTM!

wled00/wled.cpp: 1

673-677: LGTM!

wled00/FX.h: 1

943-943: 🎯 Functional Correctness

No supported caller remains.

The only repository caller was wled.cpp, and this change removes that call. No usermod or example caller requires a compatibility shim.

Walkthrough

The strip show callback API and stored callback were removed. WS2812FX::show() now draws overlays directly. BusManager::blank() clears pixels across buses, and beginStrip() uses BusManager to blank and show when no relay pin is configured.

Changes

Strip Show and Initialization

Layer / File(s) Summary
Remove the show callback
wled00/FX.h, wled00/FX_fcn.cpp
WS2812FX no longer declares or stores a show callback. WS2812FX::show() calls handleOverlayDraw() to draw overlays.
Clear buses during strip initialization
wled00/bus_manager.h, wled00/bus_manager.cpp, wled00/wled.cpp
BusManager::blank() sets every pixel on each bus to black. When no relay pin is configured, beginStrip() blanks and shows through BusManager. It resets doInitBusses after strip initialization.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: dedehai, softhack007

Merge Risk: Minimal · up to 83c0b

The changed boot path blanks the LEDs without invoking overlays before setup. No issue identified here requires a fix before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 36.36% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title accurately describes the primary change: preventing usermod overlays from running before setup during strip initialization.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread wled00/bus_manager.cpp
@softhack007

softhack007 commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

This is the right fix 👍 much better than adding quirks into usermods that need to draw as an overlay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants