#4580·FastLED

Meta: convert all legacy addLeds controllers to the slim bridge (all platforms)

Author: zackeesCreated Sep 25, 2026Updated Sep 25, 2026

Meta issue for converting every legacy FastLED.addLeds<>() controller (clockless and clocked, all platforms) to the slim bridge format. It was split out of #2856 (ESP32-S3 binary-size Batch 3) because the scope outgrew that issue. The work started as draft #4576.

Directive (2026-09-24): convert every legacy clockless and clocked controller to the slim bridge

Decision: every legacy FastLED.addLeds<>() controller, clockless and clocked (SPI), on every platform, moves to the slim bridge format. ChannelManager stays the single back-end entry point. The legacy controller stops being an fl::Channel.

The slim bridge format

  • The legacy controller is a plain CPixelLEDController<RGB_ORDER>. It does not inherit fl::Channel, and it is not created through TypedChannel::create() or held in a static ChannelPtr.
  • It owns one ChannelData. The encode buffer is cleared and refilled every frame (clear() keeps capacity), so the show path allocates nothing after the first frame.
  • showPixels() encodes with the compile-time PixelController<RGB_ORDER>, then enqueues the ChannelData on the bus driver (BusTraits<Bus::X>::instance()).
  • The constructor calls BusTraits<Bus::X>::registerWithManager(), which is idempotent. ChannelManager then owns the frame: the begin-frame wait, the end-frame show() and the async drain. Legacy and Channel API strips share one back end and one async model.
  • Not linked for a legacy sketch: the fl::Channel object, channel events, dynamic driver resolution, and the runtime RGB-reorder / PixelIteratorAny pipeline.
  • Legacy addLeds loses: colour-management profiles, 5-channel RGBWW, channel events and dynamic driver fallback. These remain on FastLED.add(Channel).

Evidence (draft #4576, ESP32 RMT5 ClocklessIdf5)

  • Size: ESP32-S3 Blink firmware.bin 424,880 → 402,352 B (−22,528 B); symbol flash −19,678 B.
  • Where the saving comes from: the fl::Channel object (−7,963 B), logging (−3,029 B), the controller ctor / static init (−2,198 B), channel events (−2,039 B) and the duplicate RGB pipeline (−1,181 B). ChannelManager itself is kept.
  • Hardware (ESP32-C6, AutoResearch):
    • --rmt --legacy --chipset ws2818 passes at 1, 2, 3, 4 and 100 LEDs.
    • --rmt (Channel API) passes on the same build.
    • --chipset ws2814 fails identically on master; filed as #4578.

Controllers to convert

Clockless (ESP32 family, src/platforms/esp/clockless.h)

  • ClocklessIdf5: RMT, IDF 5; default on ESP32/S3/C3. Draft #4576.
  • ClocklessPARLIO: default on C6/P4/H2/C5. Currently an fl::Channel.
  • ClocklessIdf4: RMT, IDF 4. Already a plain controller, but never registers its driver with ChannelManager. Suspected: the enqueued data may never be flushed (initChannelDrivers() is empty since #2469). Verify on hardware and register it.
  • ClocklessSPI: clockless over SPI, the ESP32-S2 default. Same missing registration as ClocklessIdf4.
  • ClocklessBlocking: CPU bit-bang with no driver. Nothing to bridge.

Clocked / SPI chipsets (src/FastLED.h, FASTLED_SPI_USES_CHANNEL_API: ESP32, Teensy 4.x, RP2040/2350)

  • The four addLeds<ESPIChipsets CHIPSET, DATA_PIN, CLOCK_PIN, ...> overloads, covering APA102, SK9822, HD107, HD108, WS2801, LPD8806 and the rest. Today each builds a full fl::Channel via TypedChannel<B, SpiChipsetConfig, B_WHICH>::create() held in a static ChannelPtr. Replace them with a slim templated SPI controller that owns a ChannelData built from SpiChipsetConfig / SpiEncoder and enqueues on the SPI bus driver.

Other channel-capable platforms (Teensy 4.x, RP, STM32, SAMD, NRF52, LPC). Audit each legacy controller against the same format. Several already own a ChannelData (stub, WASM, LPC). Each still needs the check that it registers with ChannelManager rather than enqueuing into an unflushed driver.

Follow-up once no legacy path depends on it: remove the legacy-only machinery from fl::Channel:

  • the CPixelLEDController base;
  • the mDriverPreBound flag;
  • RegistrationMode::DeferRegister;
  • the legacy-only busKeepAlive path.

Scope: every platform with a clockless controller (2026-09-24)

The directive is not ESP32-only. Every legacy addLeds<> clockless controller on every platform moves to the shared slim-bridge template (fl::SlimBridgeController<..., DriverTraits>, see Testing plan → T0). So do the clocked SPI addLeds overloads.

DriverTraits come in two kinds. This keeps small targets small:

  • Bridged: platforms with a channel back end. DriverTraits wraps BusTraits<Bus::X>, registers with ChannelManager, and is async.
  • Direct: bit-bang / inline-asm platforms with no channel driver (AVR, ATtiny, ESP8266, K20, and so on). DriverTraits transmits synchronously inside showPixels() and links no ChannelManager, ChannelData or shared_ptr.
    • The goal is one controller structure and one conformance suite everywhere, with no flash increase on those targets. Check it with same-SHA bash bloat on an AVR (uno) and an ATtiny board before converting them.
    • Open decision: whether "Direct" platforms convert now or are exempted. The inventory below lists them either way.

Exhaustive inventory (62 controller files, from master at 2ea73441fe)

Found by scanning src/platforms/** for classes deriving CPixelLEDController or fl::Channel that implement clockless / WS281x-style output. The same scan is the lint's detection rule below.

Heavy: an fl::Channel subclass or built as a Channel. Convert to Bridged.

  • src/platforms/esp/32/drivers/parlio/clockless_parlio_esp32.h (ClocklessPARLIO)
  • src/FastLED.h clocked addLeds<ESPIChipsets...> ×4 (TypedChannel::create + static ChannelPtr), where FASTLED_SPI_USES_CHANNEL_API is set: ESP32, Teensy 4.x, RP2040/2350.

Slim-shaped, but the driver is never registered with ChannelManager. These are the B1 bug class: they must register, then move onto the template.

  • src/platforms/esp/32/drivers/rmt/rmt_4/idf4_clockless_rmt_esp32.h (ClocklessIdf4)
  • src/platforms/esp/32/drivers/spi/idf5_clockless_spi_esp32.h (ClocklessSPI)
  • src/platforms/arm/lpc/clockless_channel_lpc.h
  • src/platforms/arm/lpc/clockless_channel_lpc_uart_dma.h
  • src/platforms/stub/clockless_channel_stub.h
  • src/platforms/stub/spi_channel_stub.h
  • src/platforms/wasm/clockless_channel_wasm.h
  • src/platforms/wasm/spi_channel_wasm.h

For the stub and WASM entries, first verify how they flush today. The stub comment says it "bypasses ChannelManager entirely", so it may self-flush.

Compliant, pending the template extraction

  • src/platforms/esp/32/drivers/rmt/rmt_5/idf5_clockless.h (ClocklessIdf5, draft #4576)

Pure legacy: no channel back end. Direct traits, or exempted per the open decision.

Group Files
AVR / ATtiny avr/clockless_avr.h; avr/attiny/clockless_blocking.h; avr/attiny/clockless_blocking_controller.h
Shared / fallback shared/clockless_blocking.h (ClocklessBlockingGeneric); stub/clockless_stub_generic.h (ClocklessController, ClocklessBlockController); adafruit/clockless.h; neopixelbus/clockless.h (×2)
ESP8266 / ESP32 block esp/8266/clockless_esp8266.h; esp/8266/clockless_block_esp8266.h; esp/8266/fastled_esp8266_uart.h; esp/32/clockless_block_esp32.h
Teensy 3.x / LC / K20 / K66 / KL26 arm/teensy/teensy31_32/{clockless_arm_k20, clockless_block_arm_k20 (×2), octows2811_controller, smartmatrix_t3, ws2812serial_controller}.h; arm/teensy/teensy36/{clockless_arm_k66, clockless_block_arm_k66 (×2)}.h; arm/teensy/teensy_lc/clockless_arm_kl26.h; arm/k20/{clockless_block_arm_k20 (×2), octows2811_controller, smartmatrix_t3, ws2812serial_controller}.h; arm/k66/{clockless_arm_k66, clockless_block_arm_k66 (×2)}.h; arm/kl26/clockless_arm_kl26.h
Teensy 4 / MXRT1062 arm/teensy/teensy4_common/{clockless, clockless_arm_mxrt1062 (BitBang), block_clockless_arm_mxrt1062, octows2811_controller}.h; arm/mxrt1062/{clockless_arm_mxrt1062, block_clockless_arm_mxrt1062, octows2811_controller}.h. The ObjectFLED proxy has a channel engine (ChannelEngineObjectFLED), so it is a Bridged candidate.
RP2040 / RP2350 arm/rp/rpcommon/clockless_rp_pio.h; clockless_rp_pio_parallel.h. RP has channel engines (PIO/UART/SPI), so these are Bridged candidates.
SAMD / SAM arm/d21/clockless_arm_d21.h; arm/d51/clockless_arm_d51.h; arm/sam/clockless_arm_sam.h; arm/sam/clockless_block_arm_sam.h
STM32 / GIGA arm/stm32/clockless_arm_stm32.h (×2); arm/giga/clockless_arm_giga.h
nRF arm/nrf51/clockless_arm_nrf51.h; arm/nrf52/clockless_arm_nrf52.h
LPC (non-channel) arm/lpc/clockless_arm_lpc.h; arm/lpc/clockless_arm_lpc_plu.h
Other apollo3/clockless_apollo3.h; arm/renesas/clockless_arm_renesas.h; arm/mgm240/{clockless_arm_mgm240, clockless_ezws2812_39mhz, clockless_ezws2812_78mhz, clockless_ezws2812_gpio, clockless_ezws2812_spi}.h; ci13xx/clockless_ci13xx.h

FASTLED_HAS_CHANNELS is 1 for ESP32, Teensy 4.x, RP, STM32, SAMD and NRF52. For those platforms, check whether a channel driver already exists to back a Bridged conversion. STM32, SAMD and NRF52 legacy clockless controllers do not use one today.

Tracking: one sub-issue per conversion unit

Progress is tracked by native sub-issues of this meta issue. There is no checked-in lint, and master is never turned red by this work. Each sub-issue:

  • names the controller files it covers, from the inventory above;
  • must pass the T1 conformance suite for its DriverTraits;
  • must carry a same-SHA bash bloat before/after;
  • must include AutoResearch evidence where hardware is available.

Optional: a contributor may keep an uncommitted, local-only scan while working, using the detection rule "class derives CPixelLEDController/Channel, is clockless-style, and is not on fl::SlimBridgeController". It must not be checked in.

The meta issue closes when every sub-issue is closed.

Known gaps of the slim bridge (audit of draft #4576, 2026-09-24)

This is a register, not a fix list. Each conversion PR decides which gaps to close and which to accept and document.

Legend:

  • Status: Regression = worked through fl::Channel before and is lost in the slim bridge. Pre-existing = already true before #4576. Coverage = a verification gap.
  • Verified: code = confirmed by reading the source. inferred = not reproduced.

A. Behaviour gaps in the slim controller itself (idf5_clockless.h)

# Gap Status Impact Verified
A1 Disabled / non-exclusive driver not honoured. Channel::submitFrame checked ChannelManager::driverStatus() and skipped a disabled driver with a one-shot error. The slim controller always enqueues. After setExclusiveDriver(other) or setDriverEnabled("RMT", false), onEndFrame skips show(), the buffer stays in use, and the next waitForReady() stalls until its 1 s timeout. Regression Stall and no LED output, silently code; stall inferred
A2 clearAllDrivers() / removeDriver() orphan the driver. The controller reaches the driver through the BusTraits<Bus::RMT> singleton, not the registry. After the RMT driver leaves mDrivers (e.g. FastLED.clear(CHANNEL_ENGINES)), data is still enqueued but never shown. Channel re-resolved the driver each frame when it was not pre-bound, but the old pre-bound ClocklessIdf5 also cached it. Regression, partly pre-existing No output after a clear, silently code; inferred
A3 RGBWW dropped. showPixels builds pixels.as_iterator(getRgbw()) and never passes getRgbww(), so CLEDController::setRgbww() on a legacy strip is ignored. The old path passed both to ReorderingPixelIteratorAny, and writeWS2812 has an RGBWW branch. Regression Wrong bytes for 5-channel strips code
A4 Colour profile / colour pipeline ignored. Channel::encodeFrame fed mPipeline (StreamingPipelineQ16, FL_COLOR_PROFILE_RUNTIME) from the controller's profile settings (bindStaticEmitterProfile, mSettings.mColorProfile). The slim path never reads them. This includes .fled-declared colour (#4460). Regression, but only for legacy strips that bind a profile; none by default Colour output differs when a profile is bound code
A5 Pixel-format tag not set. Channel called ChannelData::setPixelFormat(RGB/RGBW/RGBWW) each frame; the slim path never does. No ESP32 driver reads the tag. LPC SCT-DMA and Teensy ObjectFLED do read it, so their conversions must set it. Regression (latent on ESP32) None on ESP32; wrong on LPC/Teensy if copied as-is code
A6 Dither phase semantics. Channel advanced mDitherPhase only when a driver accepted a frame (#4347/#4452). The slim path uses classic legacy CPixelLEDController dithering, the same as RMT4 and pre-channel FastLED. The two differ only on dropped frames. There is no ditherPhase() introspection. Regression vs. interim Channel path Minor temporal-dither difference code
A7 Per-frame channel events no longer fire. onChannelDataEncoded and onChannelEnqueued fired for the old Channel-backed legacy strip. onChannelAdded never did, because it used addToList(). No in-tree consumer depends on them for legacy strips. Regression (API surface) Only for user listeners code
A8 Silent frame drop under backpressure. When the buffer is in use and waitForReady() fails, the slim path returns with no log. Channel::waitForInUseBuffer warned. Regression (diagnostics) Harder to debug code
A9 No per-frame null / canHandle() guard. Allocation failures (e.g. more strips than RMT channels) surface asynchronously inside the driver, not at the controller. Largely pre-existing (pre-bound path) Diagnostics code
A10 WAIT_TIME template parameter ignored. ClocklessIdf4 folds WAIT_TIME into reset_us; RMT5 does not, and neither did the old Channel-backed version. Pre-existing Latch time differs between IDF4 and IDF5 code
A11 Only the WS2812 encoder is used. Non-WS2812 clockless encoders (TM1812 RGBWW, TM1908, UCS7604, 16-bit) are not selected. The old ClocklessIdf5 also hard-coded ws2812PixelEncoder(). Pre-existing Any such chipset routed through ClocklessController on RMT5 was already WS2812-encoded code
A12 FastLED.clear(CHANNELS) does not touch legacy strips. Already-enqueued legacy data can still be shown after a clear. Pre-existing Minor inferred

Not gaps (checked):

  • Plain WS2812 RGB/RGBW bytes: identical; both paths call writeWS2812.
  • Power-limiter codec policy: powerChannelCodecPolicy never matched legacy strips, which are not in CFastLED::channels(), so it is unchanged.
  • Classic power limiter: unchanged.
  • Static-init / PSRAM timing: same as Channel.
  • Buffer reuse: clear() keeps capacity, so there is no steady-state allocation.
  • ChannelManager poll semaphore: still linked in the bridged version.
  • WASM strip enumeration: uses EngineEvents, not Channel.
  • AutoResearch legacy harness: never casts to Channel.

B. Gaps found in the controllers still to convert

# Finding Verified
B1 ClocklessIdf4 (RMT4) and ClocklessSPI (ESP32-S2 default) never register with ChannelManager. They talk to their drivers directly (comment: "bypass ChannelManager", Phase 5c of #2428). ChannelManager::onEndFrame is the only caller of driver->show() in the tree, so their enqueued data is likely never transmitted. code; hardware repro still needed (IDF4 build, ESP32-S2)
B2 LPC clockless_channel_lpc*.h is already slim but needs the same registration audit as B1. not yet checked
B3 ClocklessPARLIO is the last ESP32 clockless Channel subclass. ChannelDriverPARLIO groups and batches by ChannelData timing, so the conversion looks mechanical. DMA scratch-buffer ownership relative to the Channel lifetime is unverified. code; inferred low risk
B4 Clocked/SPI addLeds<ESPIChipsets...> (FastLED.h ~1150-1235). A slim version must replicate: per-chipset SpiEncoder selection; APA102/SK9822/HD107/HD108 brightness-field handling (#4441, #4457, #4464); HD108's GRB default; Esp32SpiBus host selection; end-frame bytes (spi_channel_adapter.*). The least-explored target. partially read
B5 Teensy 4 ObjectFLED legacy ClocklessController uses its own draw-buffer proxy, not ChannelData, so it needs a full conversion. ChannelEngineObjectFLED reads getPixelFormat() (see A5). code
B6 RP2040/2350 legacy clockless (clockless_rp_pio*.h) predates the channel system and has no ChannelData integration. Per the agent audit, STM32/SAMD/NRF52 legacy controllers also look pre-channel. Out of scope until a ChannelData driver exists for each. inferred

C. Verification / coverage gaps

  • C1: idf5_clockless.h is ESP32-only (FASTLED_RMT5), so host tests never compile it. The stub twin platforms/stub/clockless_channel_stub.h is a separate implementation (Bus::BIT_BANG, no in-use wait), so its tests do not prove the RMT5 file. To close it: compile the real header against the RMT5 peripheral mock in a host test.
  • C2: Nothing covers:
    • A1/A2 (disabled, exclusive or removed driver) with a legacy strip;
    • more legacy strips than RMT channels;
    • legacy and FastLED.add(Channel) strips in the same frame;
    • showColor/clear/reset on legacy strips;
    • legacy-vs-Channel byte parity for the same pixels. The #4566 parity tests compare Channel paths only.
  • C3: Legacy RGBW over RMT5 on hardware is blocked by #4578. --lanes >1 with --legacy has not been run for #4576.
  • C4: Routine PR CI skips the board matrix, so ESP32 compile/bloat for this header runs only with ci-full or the ci-test:bloat label.

Stale comments to update when converting:

  • examples/AutoResearch/LegacyClocklessProxy.h:6, AutoResearchTimingDrift.h:6 and AutoResearchTest.cpp:1651 describe the path as ... -> ClocklessIdf5 -> Channel.
  • channel_typed.h:61 lists ClocklessIdf5 as a Channel consumer.

Testing plan: catch every gap in a host unit test

Goal: every item in the gap register (A1-A12, B1-B5, C1-C2) has a host unit test (bash test) that fails when the gap exists. Regressions we choose to fix go RED → GREEN; gaps we choose to accept get a test that pins the accepted behaviour, so a later change is a visible, deliberate decision.

T0. Prerequisite: one shared, host-compilable slim controller

Today each platform hand-writes its own copy of the legacy controller:

  • ESP32 ClocklessIdf5 (RMT5), ClocklessIdf4 (RMT4) and ClocklessSPI;
  • the host stub clockless_channel_stub.h;
  • LPC clockless_channel_lpc*.h.

The ESP32 ones compile only with FASTLED_RMT5 / ESP-IDF, so no host test exercises them (C1), and the copies have already drifted (B1, A10).

  • Extract the controller into one template, e.g. fl::SlimBridgeController<DATA_PIN, TIMING, RGB_ORDER, WAIT_TIME, DriverTraits> in src/fl/channels/slim_bridge_controller.h, with no platform includes.
    • DriverTraits supplies instance(), instancePtr(), registerWithManager() and the driver name. These are BusTraits<Bus::X> on device, and a test traits type on host.
    • All the gap-relevant logic lives here, so a host test of it tests the device code:
      • registration;
      • the driver-status check;
      • the in-use wait;
      • pixel-format tagging;
      • RGBW/RGBWW selection;
      • the encoder;
      • WAIT_TIME → reset_us;
      • buffer reuse.
  • Every platform legacy controller (ClocklessIdf5, ClocklessPARLIO, ClocklessIdf4, ClocklessSPI, LPC, stub) becomes a thi