Skip to content

feat(channels): addLeds falls back to the enabled driver when its own is disabled, warning every second - #5213

Merged
zackees merged 2 commits into
masterfrom
feat/addleds-driver-fallback
Nov 9, 2026
Merged

zackees merged 2 commits into
masterfrom
feat/addleds-driver-fallback

Conversation

@zackees

@zackees zackees commented Nov 9, 2026

Copy link
Copy Markdown
Member

When an addLeds<> strip's driver is not enabled, the strip now falls back to an enabled driver and warns with FL_WARN_EVERY(1000, ...). The warning names the fallback and the fix.

Changes

  • SlimBridgeController (clockless addLeds<>), driver disabled. This happens through setDriverEnabled or setExclusiveDriver.
    • Before: it dropped every frame after a single FL_WARN_ONCE.
    • Now: the frame goes to the highest-priority enabled driver that can take it. The warning reads: addLeds: driver 'X' is not enabled - falling back to 'Y'. Fix: FastLED.setDriverEnabled("X", true), or name the enabled bus in addLeds<..., fl::Bus::X>().
    • No fallback: if no driver can take the strip, the frame is still dropped, and the warning repeats every second.
    • Direct-show mode (no manager) is unchanged.
  • SlimSpiBridgeController and the Channel API: the bus-miss diagnostics now repeat every second instead of once.
    • They distinguish three cases: not enabled, disabled, and bus/chipset mismatch. Each message names the driver actually in use and its own fix.
    • The mBusWarned one-shot flag is removed, saving 1 byte per channel.
  • ChannelManager::selectDriverForChannel: a request by name no longer returns a disabled driver; it falls through to priority dispatch.
    • Bug fixed along the way: the Channel and SPI paths could enqueue to a disabled driver.
    • New helper: selectEnabledDriverForChannel() is the quiet lookup the fallback uses.

Evidence

  • Tests: slim_bridge_controller gains a fallback test, with the frame landing on the enabled driver, and a no-alternative drop test. The onBeforeEncode test now disables every driver to keep testing the drop path.
    • Quick and debug runs pass.
    • bash test --cpp: 362/362 unit, 95/95 examples. The first run had a compile failure that didn't repeat on rerun; it looks like a build race.
  • esp32c6 bash bloat: Blink 317,352 → 317,552 B flash (+200), RGBWW +148 B. RAM is unchanged.
  • Lint is clean.
  • Not tested on hardware.

…is disabled, warning every second

A legacy addLeds strip whose driver is disabled (setDriverEnabled /
setExclusiveDriver) used to drop every frame after one FL_WARN_ONCE.
It now enqueues to the highest-priority enabled driver that can take
the strip, and FL_WARN_EVERY(1000) names the fallback and the fix. The
Channel API bus-miss diagnostic and the SPI bridge likewise repeat every
second instead of once. ChannelManager affinity lookups no longer return
a disabled driver.

esp32c6: Blink +200 B flash, RAM unchanged.
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 4 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 20cffff and 4cc931b.

Files selected for processing: 8

  • src/fl/channels/README.md
  • src/fl/channels/channel.cpp.hpp
  • src/fl/channels/channel.h
  • src/fl/channels/manager.cpp.hpp
  • src/fl/channels/manager.h
  • src/fl/channels/slim_bridge_controller.h
  • src/fl/channels/slim_spi_bridge_controller.h
  • tests/fl/channels/slim_bridge_controller.cpp
  • 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

@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 9, 2026
@github-actions github-actions Bot added the sanitized Title, body and conversation screened; review text requires separate screening. label Nov 9, 2026
@zackees
zackees added this pull request to the merge queue Nov 9, 2026
@github-actions github-actions Bot added sanitized Title, body and conversation screened; review text requires separate screening. and removed sanitized Title, body and conversation screened; review text requires separate screening. labels Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Memory usage (this PR vs. its merge base)

Change in examples/Blink per target. The left number is this PR's image flash / attributed RAM in bytes; the colored delta is the change from the merge base (red ↑ is larger, green ↓ is smaller, Same is unchanged).

Target FLASH [bytes] RAM [bytes]
attiny85 2,460 (Same) 136 (Same)

Merged via the queue into master with commit 8d4639f Nov 9, 2026
130 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Nov 9, 2026
@zackees
zackees deleted the feat/addleds-driver-fallback branch November 17, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sanitized Title, body and conversation screened; review text requires separate screening.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant