Repository navigation
fix(esp32p4): route legacy clockless controllers through PARLIO - #2515
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR adds a new ClocklessPARLIO driver for ESP32 PARLIO bus, wires it as the default clockless controller for ESP32-P4/C6/H2/C5 targets, and conditionally includes the driver header in the ESP32 platform core when PARLIO support is enabled. ChangesPARLIO Clockless Driver Integration
Sequence DiagramsequenceDiagram
participant User
participant ClocklessPARLIO
participant PRLIOManager as PARLIO Manager
participant PRLIODriver as PARLIO Driver
User->>ClocklessPARLIO: construct(DATA_PIN, TIMING)
ClocklessPARLIO->>PRLIOManager: defer_registration()
ClocklessPARLIO->>PRLIOManager: register(driver_instance)
PRLIOManager->>PRLIODriver: attach instance
ClocklessPARLIO->>ClocklessPARLIO: add to internal channel list
User->>ClocklessPARLIO: init()
ClocklessPARLIO-->>User: no-op
User->>ClocklessPARLIO: getMaxRefreshRate()
ClocklessPARLIO-->>User: 800 Hz
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
…er (Closes #2517) (#2795) Before this change, a channel with a bound driver that had been disabled (e.g. by FastLED.setExclusiveDriver<OtherBus>()) would enqueue data to that driver every frame, but ChannelManager::onEndFrame() iterates only ENABLED drivers when calling show(), so the frame was silently dropped on the floor with no diagnostic. This was the silent-failure mode that the ESP32-P4 PARLIO no-output bug (#2515) surfaced. Adds ChannelManager::driverStatus(name) — a silent tri-state lookup (NOT_REGISTERED / DISABLED / ENABLED) — and ChannelManager:: exclusiveDriverName() accessor. Channel::showPixels() consults these immediately before driver->enqueue() and: - On DISABLED: emits a one-shot FL_ERROR naming the channel, the bound driver, the active exclusive-driver setting, and the FastLED.enableDrivers<>() / FastLED.enableAllDrivers() remediation, then skips the enqueue (the data wouldn't be transmitted anyway). - On ENABLED (happy path): clears the one-shot latch so a later disable re-emits the diagnostic, then enqueues as before. - On NOT_REGISTERED: enqueues as before (preserves the historic behaviour for custom drivers that bypass the manager). The mDisabledDriverWarned latch keeps the diagnostic from spamming once per frame — it fires once per disable event per channel. Three regression tests added to tests/fl/channels/channel.cpp: - "[#2517] Disabled driver: enqueue is suppressed" — reproduces the setExclusiveDriverByName("DOES_NOT_EXIST") silent-drop scenario and asserts the driver's enqueue count stops growing. - "[#2517] Normal flush path does NOT trigger the silent-drop FL_ERROR" — three happy-path frames, all enqueue. - "[#2517] Re-enabling the driver resumes enqueue and re-arms the latch" — covers the disable -> enable -> disable cycle. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Summary
Root cause
On ESP32-P4, DefaultBus already says PARLIO, but the legacy ClocklessController alias still picked RMT whenever RMT hardware was present. In sketches that call FastLED.setExclusiveDriver(PARLIO) and then legacy FastLED.addLeds<WS2812B, PIN, ...>(), the manager stored PARLIO as exclusive before PARLIO had been registered. The later RMT registration was auto-disabled by exclusive mode, leaving no enabled driver to transmit queued channel data at frame end.
Fixes #2513.
Requires the fbuild release+bump tracked in #2514 for the fbuild-backed verification path.
Verification
Summary by CodeRabbit