Repository navigation
fix(esp_extra_libs): clearDelayFunction guard + drop unused hal/mcpwm_ll.h - #2598
Conversation
…E_SPI Every `stm32h747xi_giga` (Arduino Giga R1) build on master fails: platforms/arm/stm32/fastspi_arm_stm32.h:11:14: fatal error: SPI.h: No such file or directory `fastspi_arm_stm32.h` pulls in Arduino's `<SPI.h>` whenever `HAL_SPI_MODULE_ENABLED` is set, but the Arduino mbed-os core that drives the Giga doesn't auto-resolve `<SPI.h>` from PlatformIO's lib finder — `SPI` has to be listed in `lib_deps`, and it isn't. Apply the same pattern as the ESP8266 fix (#2570): also require `FASTLED_ALL_PINS_HARDWARE_SPI` before pulling in the HAL SPI path. Default builds fall through to bitbang. Users who want STM32 hardware SPI define the macro and add `SPI` to their `lib_deps`. This is a one-line FastLED-side fix; no fbuild / lib_deps wrangling needed. Matches the existing opt-in convention. Fixes #2595
Two distinct errors block `esp_extra_libs` (kitchensink against pioarduino/[email protected], esp32-s3-devkitc-1): 1) `stub_main.hpp:48`: `clearDelayFunction` was not declared in scope. The call site fires unconditionally, but the include of `platforms/stub/time_stub.h` (which declares it) is gated: #if !defined(ARDUINO) || defined(FASTLED_USE_STUB_ARDUINO) #include "platforms/stub/time_stub.h" #endif On a real Arduino build there's no stub delay override to clear in the first place. Wrap the call in the same guard. 2) `mcpwm_timer.cpp.hpp:54`: including `hal/mcpwm_ll.h` triggers a hard C++ error in IDF 5.x: hal/mcpwm_ll.h:1598: error: binding reference of type 'const mcpwm_timer_cfg0_reg_t&' to 'volatile mcpwm_timer_cfg0_reg_t' discards qualifiers `mcpwm_ll_timer_get_clock_prescale` does a copy from a volatile field; the implicit copy ctor (const T&) can't bind to volatile T& under C++17+. FastLED does not actually use any `mcpwm_ll_*` function — the only IDF types referenced here (`mcpwm_dev_t`, `MCPWM0`, `cap_chn[].val`) come from `soc/mcpwm_struct.h` on the line above. Drop the unused include; add a comment for posterity. Both fixes are one-line edits to FastLED code; no fbuild or IDF changes needed. Host smoke test (`bash test fastled_core --cpp`) and `bash lint` both pass. Fixes #2597
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR fixes three independent build configuration issues across platform-specific code: STM32 HAL SPI requires explicit hardware SPI opt-in, ESP32 MCPWM driver removes an IDF 5.x incompatible include, and stub engine cleanup guards a call that exists only in stub-enabled builds. ChangesPlatform-specific build configuration guards
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Summary
esp_extra_libs(kitchensink against pioarduino IDF 5.x) was failing master with two independent errors. Both are fixable in FastLED with one-line edits; no fbuild or IDF changes needed.1.
stub_main.hpp:48—clearDelayFunctionundeclaredThe call to
clearDelayFunction()inScopedEngineCleanup::~ScopedEngineCleanupfires unconditionally, but the include of its declaring header (platforms/stub/time_stub.h) is gated:On a real Arduino build there's no stub delay override to clear. Wrap the call in the same guard.
2.
mcpwm_timer.cpp.hpp:54—hal/mcpwm_ll.hvolatile-binding errorIDF 5.x's
mcpwm_ll.h:1598doesmcpwm_timer_cfg0_reg_t cfg0 = mcpwm->timer[i].timer_cfg0;where the field is volatile. Under C++17+ the implicit copy ctor (const T&) can't bind tovolatile T&— hard error.FastLED does not actually use any
mcpwm_ll_*function. The only IDF types referenced (mcpwm_dev_t,MCPWM0,cap_chn[].val) come fromsoc/mcpwm_struct.hon the line above. Drop the unused include; add a comment for posterity.Test plan
bash lintclean (cpp_linting + others).bash test fastled_core --cpp— host smoke test still passes.esp_extra_libsworkflow should compile cleanly.Note
A third concern (
ESP_CACHE_MSYNC_FLAG_DIR_C2Matlcd_spi_peripheral_esp.cpp.hpp:364) surfaced in an earlier triage but does NOT appear in the current failure log.rmt5_peripheral_esp.cpp.hppalready has the#ifndef ESP_CACHE_MSYNC_FLAG_DIR_C2M / #define ... 0fallback; if CI ever surfaces the same onlcd_spi, that's a one-line follow-up to copy the pattern.Fixes #2597
Generated with Claude Code (https://claude.com/claude-code)
Summary by CodeRabbit