Repository navigation
fix(rx/esp32c2): gate RMT specialisation with FASTLED_ESP32_HAS_RMT - #3560
Conversation
esp32c2 has been red on master since #3467 (feat(rmt_rx): backport RmtRxChannel to IDF 4.x) with: fl.channels+.cpp:(.text._ZN2fl8RxDevice6createILNS_12RxDeviceTypeE2EEENS_10shared_ptrIS0_EEi+0x12): undefined reference to `fl::RmtRxChannel::create(int)' ESP32-C2 has no RMT peripheral (`SOC_RMT_SUPPORTED == 0` → `FASTLED_ESP32_HAS_RMT == 0`), and platforms/esp/32/feature_flags/ enabled.h forces `FASTLED_RMT5 = 0` for that chip. So neither rmt_rx_4/'s `FASTLED_ESP32_HAS_RMT && !FASTLED_ESP32_RMT5_ONLY_PLATFORM && !FASTLED_RMT5` gate NOR rmt_rx_5/'s `FASTLED_RMT5` gate compiles, and `RmtRxChannel::create` has no definition to link against. Mirror the exact gate at the specialisation site: when the SoC doesn't have RMT silicon, collapse `RxDevice::create<RMT>` to a DummyRxDevice with a clear failure string ('RMT RX not supported on this ESP32 SoC') instead of trying to call an unlinkable symbol. Also #include the feature-flags header up top so the preprocessor gate resolves. Verified locally on Windows: `bash compile esp32c2 --examples Blink` succeeds (2m04s cold, previously died in the ld step). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ESP32 RxDevice RMT factory specialization in src/fl/channels/rx.cpp.hpp now includes the ESP32 feature-flag header and gates RMT RX channel creation on FASTLED_ESP32_HAS_RMT, FASTLED_ESP32_RMT5_ONLY_PLATFORM, and FASTLED_RMT5, returning a DummyRxDevice when RMT is unsupported on the SoC or when channel creation fails. ChangesRMT RX Feature-Flag Gating
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
✨ 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 |
…ude (#3563) PR #3560 added #include "platforms/esp/32/feature_flags/enabled.h" without the '// ok platform headers' suffix the codebase uses to opt into deep-platform-header allowance. Both the PlatformIncludesChecker and PlatformTrampolineChecker lint rules rejected it, breaking every unit_test workflow (linux, macos, windows). The include is legitimate — it sits inside the existing '#ifdef FL_IS_ESP32' block alongside three siblings that already carry the suffix (rmt_rx_channel.h, gpio_isr_rx.h). Add the same suffix. Verified locally: bash lint --cpp completes green. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
esp32c2 has been red on master since #3467 (RmtRxChannel backport) with 'undefined reference to fl::RmtRxChannel::create(int)'. ESP32-C2 has no RMT peripheral (SOC_RMT_SUPPORTED == 0 → FASTLED_ESP32_HAS_RMT == 0), and platforms/esp/32/feature_flags/enabled.h forces FASTLED_RMT5 = 0 for that chip. So neither rmt_rx_4's nor rmt_rx_5's gate compiles, and RmtRxChannel::create has no definition to link.
Mirror the exact gate at the specialisation site: when the SoC doesn't have RMT silicon, collapse RxDevice::create to a DummyRxDevice with a clear failure string instead of trying to call an unlinkable symbol.
Verified locally on Windows: bash compile esp32c2 --examples Blink succeeds (2m04s cold).
Generated with Claude Code
Summary by CodeRabbit