Skip to content

refactor(channels): extract Channel::showPixels disabled-driver error into FL_NO_INLINE helper (#2773 follow-up) - #2851

Merged
zackees merged 1 commit into
masterfrom
followup/2773-2832-leftovers
Jun 6, 2026
Merged

zackees merged 1 commit into
masterfrom
followup/2773-2832-leftovers

Conversation

@zackees

@zackees zackees commented Jun 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Rebased onto master to drop the now-duplicate piece. Original PR had two parts; the maintainer landed half of it in parallel as iter 6 (commit ea96b37, perf(channels): gate addDriver capStr builder behind FASTLED_HAS_DBG), so only the unique emitDisabledDriverError extraction remains.

What's left

The two-branch FL_ERROR(... << ...) chain in Channel::showPixels that fires when a bound driver has been runtime-disabled (typically by FastLED.setExclusiveDriver<OtherBus>()) was still inlined into the hot path. The branch is one-shot (mDisabledDriverWarned) and unreachable in the steady state, so the ~10 operator<< instantiations were pure cold-path bloat sitting in showPixels' prologue/epilogue.

Moves into an anonymous-namespace helper marked FL_NO_INLINE (per the bare_noinline_checker introduced in #2830, not bare __attribute__((noinline))), matching the shape the maintainer adopted for resolveDynamicDriver() in PR #2830.

The closing comment on the original #2832 explicitly flagged this piece as worth a follow-up:

The two pieces this PR has that #2830 didn't (emitDisabledDriverError and the #if FASTLED_HAS_DBG gate on ChannelManager::addDriver's capStr builder) are small enough (~couple hundred bytes) that a rebase round trip isn't worth the churn vs just reopening them in a follow-up.

Verification

Refs #2773.

🤖 Updated by Claude Code after rebase.

Summary by CodeRabbit

  • Refactor
    • Reorganized internal error handling logic for improved code maintainability and consistency.

@coderabbitai

coderabbitai Bot commented Jun 6, 2026 •

Copy link
Copy Markdown

Linter diff in the way? Review this PR in Change Stack to focus on meaningful changes and expand context only when needed.

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f381d879-4730-44f0-913a-e81d06c93033

📥 Commits

Reviewing files that changed from the base of the PR and between 9c52645 and 5037f78.

📒 Files selected for processing (1)
  • src/fl/channels/channel.cpp.hpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/fl/channels/channel.cpp.hpp

📝 Walkthrough

Walkthrough

The PR extracts the DISABLED-driver error diagnostic logic from Channel::showPixels into a new FL_NO_INLINE static helper function emitDisabledDriverError that conditionally formats one of two FL_ERROR message variants based on whether an exclusive driver is active.

Changes

Disabled driver error diagnostic helper

Layer / File(s) Summary
Disabled driver error diagnostic helper
src/fl/channels/channel.cpp.hpp
A new FL_NO_INLINE static helper emitDisabledDriverError encapsulates the DISABLED-driver FL_ERROR message formatting logic, selecting between an exclusive-driver variant and a generic DISABLED message. The inline diagnostic code in Channel::showPixels is replaced with a call to this helper, passing the channel name, resolved driver name, and the exclusive driver name from the manager instance.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • FastLED/FastLED#2821: Modifies the same Channel::showPixels disabled-driver handling path through enum rename and caller updates.
  • FastLED/FastLED#2795: Introduced the original "driver is DISABLED" one-shot FL_ERROR emission and exclusive-driver optional string that this PR now refactors into a helper.

Poem

🐰 A helper bunny hops to tidy the logs,
Cold errors now live in their own cozy fog,
No more inline mess in the hot-path dance—
The channel shows pixels with optimization's glance! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 summarizes the primary change in the pull request: extracting disabled-driver error logic into a helper function. It is specific, concise, and clearly communicates the main refactoring objective.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch followup/2773-2832-leftovers

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 and usage tips.

… into FL_NO_INLINE helper (#2773 follow-up to #2832)

The two-branch `FL_ERROR(... << ...)` chain in `Channel::showPixels`
that fires when a bound driver has been runtime-disabled (typically
by `FastLED.setExclusiveDriver<OtherBus>()`) was still inlined into
the hot path. The branch is one-shot (`mDisabledDriverWarned`) and
unreachable in the steady state, so the ~10 `operator<<`
instantiations were pure cold-path bloat sitting in showPixels'
prologue/epilogue.

Move into an anonymous-namespace helper marked `FL_NO_INLINE` (per
the `bare_noinline_checker` introduced in #2830, not bare
`__attribute__((noinline))`), matching the shape the maintainer
adopted for `resolveDynamicDriver()` in PR #2830.

This is the leftover piece from PR #2832, which the maintainer
flagged in the closing comment as worth a follow-up:

> The two pieces this PR has that #2830 didn't (emitDisabledDriverError
> and the #if FASTLED_HAS_DBG gate on ChannelManager::addDriver's
> capStr builder) are small enough (~couple hundred bytes) that a
> rebase round trip isn't worth the churn vs just reopening them in
> a follow-up.

The `addDriver` capStr DBG gate piece of #2832 was independently
shipped by the maintainer as iter 6 (commit `ea96b373b5`,
`perf(channels): gate addDriver capStr builder behind FASTLED_HAS_DBG
(#2773 iter 6)`), so this rebase drops that half and keeps only the
unique `emitDisabledDriverError` extraction.

Refs #2773.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@zackees
zackees force-pushed the followup/2773-2832-leftovers branch from 9c52645 to 5037f78 Compare June 6, 2026 03:33
@zackees zackees changed the title refactor(channels): extract disabled-driver error + DBG-gate addDriver capStr (#2773 follow-up) refactor(channels): extract Channel::showPixels disabled-driver error into FL_NO_INLINE helper (#2773 follow-up) Jun 6, 2026
@zackees
zackees merged commit 27ea4ce into master Jun 6, 2026
6 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 6, 2026
@zackees
zackees deleted the followup/2773-2832-leftovers branch August 21, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant