Repository navigation
feat(esp32): select SPI host per controller (#1516) - #4088
Merged
Merged
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (20)
📝 WalkthroughWalkthroughAdds explicit ChangesESP32 SPI bus selection
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant FastLED
participant SpiChannelEngineAdapter
participant SPIBusManager
participant ESP32SPIOutput
FastLED->>SpiChannelEngineAdapter: register channel with requested Esp32SpiBus
SpiChannelEngineAdapter->>SPIBusManager: register device and requested bus
SPIBusManager->>SPIBusManager: select matching controller or AUTO controller
SPIBusManager->>ESP32SPIOutput: initialize selected SPI host
FastLED->>SpiChannelEngineAdapter: FastLED.show()
SpiChannelEngineAdapter->>ESP32SPIOutput: transmit LED data
✨ 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 |
zackees
added a commit
that referenced
this pull request
Sep 1, 2026
…) (#4115) Seven board builds were red on master since #4088: arduino_uno_q, nucleo_f429zi, nucleo_f439zi, stm32f103c8_bluepill, stm32f103cb_maplemini, stm32f103tb_tinystm, check_stm32f103c8_bluepill_size. fl/spi_bus.h declared `enum class Esp32SpiBus { AUTO, SPI2 = 2, SPI3 = 3 }` and reaches every platform through fl/channels/cled_controller.h. On STM32 the CMSIS device headers get there first and define those names as object-like macros -- `#define SPI2 ((SPI_TypeDef *) SPI2_BASE)` -- so the preprocessor rewrote the enumerator into `((SPI_TypeDef *) SPI2_BASE) = 2,` and the file failed to parse. Renamed to HOST2 / HOST3, which is also closer to what they are: ESP-IDF's SPI2_HOST and SPI3_HOST. Wire values unchanged. The alternatives were worse. `#undef SPI2` in a core FastLED header would delete a CMSIS peripheral macro out from under user sketches on STM32. Guarding the enum on `#if defined(ESP32)` leaves the type undeclared everywhere else while core code references it unconditionally. tests/fl/spi_bus_macro_collision.cpp defines CMSIS-shaped macros before including the header, reproducing the failure without an ARM toolchain -- verified failing on the old names and passing on the new. It also defines HSPI/VSPI, because Arduino-ESP32 3.1.0+ defines SPI2 as well: this was never STM32-specific, which is why it gets a standing guard. 288/288 unit tests, including the new one. Closes #4113 Refs #4088
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Validation:
Closes #1516
Summary by CodeRabbit
New Features
Documentation