Skip to content

fix(rx/esp32c2): gate RMT specialisation with FASTLED_ESP32_HAS_RMT - #3560

Merged
zackees merged 1 commit into
masterfrom
fix/esp32c2-rmt-rx-dummy
Jul 1, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/esp32c2-rmt-rx-dummy

Conversation

@zackees

@zackees zackees commented Jul 1, 2026 •

Copy link
Copy Markdown
Member

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

  • Bug Fixes
    • Improved ESP32 RMT receive setup so unsupported chips now fail immediately with a clearer “not supported” message instead of attempting unsupported initialization.
    • Kept the existing fallback behavior for supported chips when RMT channel creation fails, helping avoid confusing or inconsistent startup issues.

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]>
@zackees
zackees merged commit 2f285a3 into master Jul 1, 2026
@zackees
zackees deleted the fix/esp32c2-rmt-rx-dummy branch July 1, 2026 23:22
@coderabbitai

coderabbitai Bot commented Jul 1, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e14b3b0f-e7a1-42c4-8ef6-1ee7178ccd33

📥 Commits

Reviewing files that changed from the base of the PR and between 859bd09 and 4106016.

📒 Files selected for processing (1)
  • src/fl/channels/rx.cpp.hpp

📝 Walkthrough

Walkthrough

The 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.

Changes

RMT RX Feature-Flag Gating

Layer / File(s) Summary
Gate RMT RX creation with feature flags
src/fl/channels/rx.cpp.hpp
Adds an ESP32 feature-flag include and reworks the RMT factory specialization to check compile-time gates, returning DummyRxDevice directly when RMT is unsupported, or after a failed RmtRxChannel::create call.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • FastLED/FastLED#3229: Related to the same FASTLED_ESP32_HAS_RMT/FASTLED_RMT5 gating flags used to select DummyRxDevice on unsupported ESP32 SoCs.
  • FastLED/FastLED#3467: Both PRs modify how RxDevice::createRxDeviceType::RMT/RmtRxChannel::create select and construct RMT RX channels.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/esp32c2-rmt-rx-dummy

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jul 1, 2026
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jul 1, 2026
zackees added a commit that referenced this pull request Jul 1, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant