Skip to content

feat(spi): slim SPI bridge controller for clocked addLeds<> (#4585) - #4613

Merged
zackees merged 4 commits into
masterfrom
feat/meta-work-4585
Sep 25, 2026
Merged

zackees merged 4 commits into
masterfrom
feat/meta-work-4585

Conversation

@zackees

@zackees zackees commented Sep 25, 2026

Copy link
Copy Markdown
Member

Closes #4585
Part of #4580

When FASTLED_SPI_USES_CHANNEL_API is set (ESP32, Teensy 4.x, RP2040/RP2350), the clocked addLeds<ESPIChipsets, DATA_PIN, CLOCK_PIN, ...> overloads now use fl::SlimSpiBridgeController (src/fl/channels/slim_spi_bridge_controller.h). They no longer build a TypedChannel + static ChannelPtr. An explicit trailing fl::Bus B / B_WHICH is still passed through.

Chipsets still on the old path: only MY9221. It stays on TypedChannel<B, SpiChipsetConfig> because Channel::encodeMY9221() only emits bytes when the channel is managed (see the header comment).

Validation

  • tests/fl/channels/spi_legacy_golden.cpp: for each chipset/overload, compares the slim path's bytes against a reference built through FastLED.add(ChannelConfig), which is the same SpiEncoder/SpiChipsetConfig/Channel encoder that the old TypedChannel path used on master. It also checks the frame structure by hand. Passes in quick mode and in --debug (ASAN/UBSAN).
  • bash test slim_bridge_controller: passes. bash test --cpp: passes. bash lint: no blocking violations.
  • bash compile {esp32s3,teensy41,rp2040} --examples Apa102: all succeed.
  • Golden + slim tests re-run after rebasing onto origin/master: pass.

Bloat (esp32s3, examples/Apa102, bash bloat esp32s3 --build)

flash firmware.bin
origin/master 463,384 B 430,512 B
this PR 433,476 B 394,800 B
delta -29,908 B -35,712 B

🤖 Generated with Claude Code

zackees and others added 4 commits September 24, 2026 20:35
…tests (#4585)

legacy/reference bound to capturedData.back() by reference, then reset()
cleared the vector (garbage size at line 194). LED buffers were stack-local
while earlier cases' controllers persist and are re-shown (ASAN
stack-use-after-return). Copy captures and make buffers static.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@zackees
zackees merged commit 63ea5f8 into master Sep 25, 2026
44 checks passed
@zackees
zackees deleted the feat/meta-work-4585 branch September 25, 2026 03:36
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Sep 25, 2026
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Sep 25, 2026
@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: FastLED/FastLED/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 74335f88-84ab-4896-a9fe-cbac2ce6eb97

📥 Commits

Reviewing files that changed from the base of the PR and between 9bf4ce3 and fa2e734.

📒 Files selected for processing (4)
  • src/FastLED.h
  • src/fl/channels/README.md
  • src/fl/channels/slim_spi_bridge_controller.h
  • tests/fl/channels/spi_legacy_golden.cpp
 _______________________________________________________________________________________________________________________________________________
< Configure, don't integrate. Implement technology choices for an application as configuration options, not through integration or engineering. >
 -----------------------------------------------------------------------------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

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.

slim bridge: clocked SPI addLeds<ESPIChipsets...> (ESP32, Teensy 4.x, RP2040/2350)

1 participant