You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(stm32): fl::Esp32SpiBus enumerators collide with CMSIS SPI2/SPI3 macros, breaking 7 ARM builds on master #4113
Failing since #4088 (c39dc599a6, "feat(esp32): select SPI host per controller"). Confirmed present on d68e1e50de, 809d0bd32d, 37c401a9ec and 6990cdc3e4 — it is not caused by any of those commits, it just predates them. I hit it while verifying master after #4112 and it is unrelated to that work.
On every STM32 target, CMSIS has already defined those names as object-like macros — stm32f439xx.h:1278:
#defineSPI2 ((SPI_TypeDef *) SPI2_BASE)
so the preprocessor rewrites the enum body to
((SPI_TypeDef *) SPI2_BASE) = 2,
which is exactly the reported diagnostics:
stm32f439xx.h:1278:29: error: expected identifier before '(' token
stm32f439xx.h:1278:29: error: expected '}' before '(' token
stm32f439xx.h:1278:43: error: expected ')' before '*' token
lib/FastLED/fl/spi_bus.h:15:1: error: expected declaration before '}' token
The blast radius is wide because fl/spi_bus.h is included from fl/channels/cled_controller.h, which is core — so the enum is compiled on every platform, not just ESP32.
Options
Rename the enumerators (BUS2/BUS3, or HOST2/HOST3). Cleanest. The public API cost is near zero: feat(esp32): select SPI host per controller (#1516) #4088 landed hours ago and examples/MultipleEsp32SpiBuses/MultipleEsp32SpiBuses.ino is the only caller.
#undef SPI2 / #undef SPI3 in fl/spi_bus.h. One line, keeps the API — but a core library header quietly deleting a CMSIS peripheral macro would also delete it from user sketches on STM32. Rude, and a latent surprise.
Compile the enum only under #if defined(ESP32). Leaves fl::Esp32SpiBus undeclared elsewhere, so every non-ESP32 reference in core would need guarding too.
Option 1 looks right. Flagging rather than doing it unilaterally since it renames a just-shipped public API — happy to take it if the shape is agreed.
Activity
fix(stm32): rename Esp32SpiBus enumerators off CMSIS macro names (Fas…