Repository navigation
fix(esp32): provide GpioIsrRx::create stub when FASTLED_RMT5=0 - #2635
Conversation
…2630) esp32c2 workflow on master fails linking examples/Remote/Remote.ino: fl.channels+.cpp: undefined reference to `fl::GpioIsrRx::create(int)' collect2: error: ld returned 1 exit status FAILED: RX Root cause: src/fl/channels/rx.cpp.hpp:99 (compiled for any FL_IS_ESP32) references GpioIsrRx::create(pin) unconditionally. The definition in src/platforms/esp/32/drivers/gpio_isr_rx/gpio_isr_rx.cpp.hpp was gated on FASTLED_RMT5 outer + SOC_MCPWM_SUPPORTED inner — so on ESP32-C2 (no RMT peripheral at all, so FASTLED_RMT5 = 0 per feature_flags), neither the MCPWM path nor the no-op stub was compiled, leaving the symbol undefined. Fix: combine both gates into a single `FASTLED_RMT5 && SOC_MCPWM_ SUPPORTED` condition so the no-op stub is the fallback for *either* missing piece — RMT-less chips and MCPWM-less chips both get a `create() -> nullptr` definition. The caller already handles a null return (wraps as DummyRxDevice("GPIO ISR RX creation failed")), so runtime semantics are unchanged for chips that already worked; new behavior on C2 is "feature unavailable at runtime" instead of "build doesn't link". Side effect: `#include "soc/soc_caps.h"` is now only pulled in when FASTLED_RMT5 is true (it's only available under the ESP-IDF tree when RMT5 is in play). Stub path doesn't need it. Refs FastLED #2623 (sibling esp32c2 failure, fixed in PR #2625). Refs FastLED #2629 (broader follow-up to eliminate FL_FFT_USE_ESP_DSP). Fixes FastLED #2630.
|
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 (1)
📝 WalkthroughWalkthroughThis PR fixes an undefined reference linker error on ESP32-C2 by restructuring conditional compilation in ChangesGpioIsrRx factory implementation gating
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
|
Local verification update: This is an upstream Arduino-ESP32 SDK packaging gap — The CI run that surfaced #2630 (run 26697900743) did not hit this framework error — it compiled the framework + FastLED library fine and only died at the link step on The fix itself is mechanically narrow:
Will file the framework SDK gap as a separate issue so users who hit it locally have a tracking link. |
Summary
esp32c2workflow on master fails linkingexamples/Remote/Remote.ino:Root cause
src/fl/channels/rx.cpp.hpp:99is compiled for anyFL_IS_ESP32and referencesGpioIsrRx::create(pin)unconditionally. The definition insrc/platforms/esp/32/drivers/gpio_isr_rx/gpio_isr_rx.cpp.hppwas gated onFASTLED_RMT5outer +SOC_MCPWM_SUPPORTEDinner:On ESP32-C2 (low-end RISC-V, no RMT peripheral at all),
feature_flags/enabled.hresolvesFASTLED_RMT5 = 0. Neither the MCPWM path nor the stub was compiled → symbol undefined → link error.Fix
Combine both gates into a single condition so the no-op stub is the fallback for either missing piece:
The caller (
rx.cpp.hpp:99-104) already handles a null return — wraps it asDummyRxDevice("GPIO ISR RX creation failed"). Runtime semantics for chips that already worked are unchanged; new behavior on C2 is "feature unavailable at runtime" instead of "build doesn't link". That matches the file's docstring intent ("Returns nullptr on platforms without MCPWM").#include "soc/soc_caps.h"is now only pulled in whenFASTLED_RMT5is true — it's only available under the ESP-IDF tree when RMT5 is in play.Verification
(I'll merge once
bash compile esp32c2 --examples Remotereports success, per the loop directive's authorization.)Related
@filterFL_FFT_USE_ESP_DSPopt-in viaFL_HAS_INCLUDEprobeFixes #2630.
Summary by CodeRabbit