Repository navigation
docs(channels): refresh README for the #2428 dual-mode API - #2458
Conversation
…bleAllDrivers + diagnostics) The channels README hadn't been updated since #2435 (Phase 3a) while the real API surface grew through #2437/2438/2441/2448/2449/2450/2451/2454/ 2456. This refresh aligns the docs with what the code actually does today. Reviewed in three independent sub-agent passes: - Pass 1 (broad accuracy): added the new dual-mode dispatch architecture section (compile-time `fl::Bus` binding vs runtime `ChannelManager`), the templated `Channel::create<Bus B>(cfg)` / `FastLED.add<Bus B>(cfg)` examples, the `ChannelConfigOf<Chipset>` + `TypedChannel<Bus, Chipset>` Phase 3b API, the `enableDrivers<>()` / `enableAllDrivers()` opt-in registry, the `FASTLED_DISABLE_LEGACY_DRIVER_REGISTRY` binary-size macro, the one-shot affinity-miss diagnostic (#2456), and the driver-name rename callout (BITBANG -> BIT_BANG, FLEXIO -> FLEX_IO, OBJECTFLED -> OBJECT_FLED). Updated the registration example to the current 2-arg `addDriver(priority, driver)` signature; the name comes from `driver->getName()`. Expanded the Reference section to list the new headers (`bus.h`, `bus_traits.h`, `all_drivers.h`, `channel_typed.h`, `ichannel.h`) and to include `findDriverByName` / `clearAllDrivers` on `manager.h`. - Pass 2 (independent verification): fixed two real bugs the first pass left in place. (a) DMA wait-pattern snippet referenced a nonexistent `EngineState::READY` — corrected to `IChannelDriver::DriverState::READY`. (b) "Overriding Engine Selection" examples called a nonexistent `FastLED.setDriverPriority(...)` — the method lives only on `ChannelManager::setDriverPriority`; rewrote both call sites to `fl::ChannelManager::instance().setDriverPriority(...)` with an explanatory comment about the API asymmetry vs the `setDriverEnabled` / `setExclusiveDriver` helpers that DO have CFastLED forwarders. - Pass 3 (polish): added missing file-scope `CRGB leds[60];` declarations to two example snippets that referenced `leds` without anchoring it. Inserted an "alternatives, not a sequence" clarifier above the three Override Methods so a careful reader doesn't think calling all three in order is intended. Verified the `Bus::AUTO` story end-to-end: `FastLED.add<fl::Bus::AUTO>(cfg)` never appears as an example (the static_assert from #2451 rejects it); only `FastLED.add(cfg)` (implicit default via `ChannelConfigOf`) and `FastLED.add(fl::Bus::AUTO, cfg)` (runtime form, clears affinity) are shown. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
📝 WalkthroughWalkthroughThis PR updates the FastLED Channels API README to document the dual dispatch model (compile-time ChangesChannels API Documentation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/fl/channels/README.md (1)
255-255: Consider documenting the two valid ChannelConfig constructor forms.The README shows two distinct constructor patterns:
ChannelConfig(pin, timing, span, order)(lines 255, 429, 478, 484)ChannelConfig(ClocklessChipset(pin, timing), span, order)(lines 52, 138)Both forms are valid API usage (confirmed by test files), but the documentation would benefit from a brief explanation of when to use each form. For example, the first form is more concise for simple clockless setups, while the second form may be useful when working with chipset objects directly or when using named channel configurations.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/fl/channels/README.md` at line 255, The README currently shows one ChannelConfig usage but doesn't explain the two valid constructor forms; add a short note describing both ChannelConfig(pin, timing, span, order) and ChannelConfig(ClocklessChipset(pin, timing), span, order) constructors, explain when to use each (e.g., the direct pin form for concise/simple clockless setups and the ClocklessChipset form when you need chipset objects or named channel configurations), and include mentions of the related symbols used in examples such as ChannelConfig, ClocklessChipset, fl::span, CRGB, and RGB so readers can easily map the examples to the API.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/fl/channels/README.md`:
- Line 255: The README currently shows one ChannelConfig usage but doesn't
explain the two valid constructor forms; add a short note describing both
ChannelConfig(pin, timing, span, order) and ChannelConfig(ClocklessChipset(pin,
timing), span, order) constructors, explain when to use each (e.g., the direct
pin form for concise/simple clockless setups and the ClocklessChipset form when
you need chipset objects or named channel configurations), and include mentions
of the related symbols used in examples such as ChannelConfig, ClocklessChipset,
fl::span, CRGB, and RGB so readers can easily map the examples to the API.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d142842a-556b-461f-a9c4-3c46f46ff47e
📒 Files selected for processing (1)
src/fl/channels/README.md
Summary
The Channel API README hadn't been updated since #2435 (Phase 3a, ~10 PRs ago). This refresh aligns the docs with what the code actually does today after #2437 / #2438 / #2441 / #2448 / #2449 / #2450 / #2451 / #2454 / #2456.
Reviewed in three independent sub-agent passes to maximize coverage.
What's now documented (was missing or wrong)
Bugs in the prior README that this fixes
Review methodology
Three independent sub-agent passes, each with its own framing prompt:
Test plan
Files changed (1)
Related
🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes