Skip to content

fix(esp32p4): route legacy clockless controllers through PARLIO - #2515

Merged
zackees merged 1 commit into
masterfrom
clud/esp32p4-parlio-legacy-clockless
May 28, 2026
Merged

zackees merged 1 commit into
masterfrom
clud/esp32p4-parlio-legacy-clockless

Conversation

@zackees

@zackees zackees commented May 28, 2026 •

Copy link
Copy Markdown
Member

Summary

  • add a legacy ClocklessPARLIO wrapper that registers and pre-binds the PARLIO channel driver
  • make ESP32-P4/C6/H2/C5 select PARLIO for legacy clockless addLeds<> controllers before falling back to RMT
  • include the PARLIO wrapper from the ESP32 platform header

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

  • git diff --check
  • uv run python ci/ci-compile.py esp32p4 --examples Blink --no-filter --backend platformio
  • uv run python ci/ci-compile.py esp32p4 --examples AutoResearch --no-filter --backend platformio

Summary by CodeRabbit

  • New Features
    • Added LED control driver support for ESP32-P4, ESP32-C6, ESP32-H2, and ESP32-C5 microcontrollers, delivering optimized hardware compatibility and enhanced performance on these newer ESP32 variants.

Review Change Stack

@zackees
zackees merged commit c66bd29 into master May 28, 2026
5 of 6 checks passed
@coderabbitai

coderabbitai Bot commented May 28, 2026 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f2d2c6c9-2197-4d7f-a5db-9afef7cf5beb

📥 Commits

Reviewing files that changed from the base of the PR and between f29daa1 and 23dd65b.

📒 Files selected for processing (3)
  • src/platforms/esp/32/core/fastled_esp32.h
  • src/platforms/esp/32/drivers/parlio/clockless_parlio_esp32.h
  • src/platforms/esp/clockless.h

📝 Walkthrough

Walkthrough

This 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.

Changes

PARLIO Clockless Driver Integration

Layer / File(s) Summary
ClocklessPARLIO driver class
src/platforms/esp/32/drivers/parlio/clockless_parlio_esp32.h
New fl::ClocklessPARLIO template channel derives from Channel and builds a ClocklessChipset. Constructor registers the PARLIO bus driver with the manager and adds the channel to the internal list. The init() override is a no-op and getMaxRefreshRate() returns a fixed 800 Hz.
ESP32 platform integration
src/platforms/esp/32/core/fastled_esp32.h, src/platforms/esp/clockless.h
Conditionally includes the new PARLIO driver header when FASTLED_ESP32_HAS_PARLIO is enabled. Adds a preprocessor branch in ClocklessController selection to map to ClocklessPARLIO with WAIT_TIME=280 for ESP32-P4/C6/H2/C5 targets, placed before the existing RMT-based fallback.

Sequence Diagram

sequenceDiagram
  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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • FastLED/FastLED#2450: Adjusts PARLIO unity-build inclusion and default routing for ESP32-P4/C6/H2/C5, complementing this PR's addition of the ClocklessPARLIO driver and type alias wiring.

Poem

🐰 A PARLIO driver, swift and bright,
Now channels data at pure light,
P4, C6, H2, C5 devices sing,
With 800 Hz refresh to bring,
Eight hundred beats, a rabbit's delight!

✨ 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 clud/esp32p4-parlio-legacy-clockless

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.

@zackees
zackees deleted the clud/esp32p4-parlio-legacy-clockless branch May 28, 2026 05:23
zackees added a commit that referenced this pull request Jun 5, 2026
…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]>
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.

bug(esp32p4): PARLIO produces no LED output on recent master

1 participant