Skip to content

fix(autoresearch): correct classic-ESP32 macro + gate pins 6/7/8 (follow-up to #3447) - #3448

Merged
zackees merged 1 commit into
masterfrom
fix/3446-correct-esp32dev-macro
Jun 30, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/3446-correct-esp32dev-macro

Conversation

@zackees

@zackees zackees commented Jun 30, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up to #3447. The pin-8 gate in that PR had two bugs:

  1. FL_IS_ESP_32 is not a real macro. The actual classic-ESP32 sentinel is FL_IS_ESP_32DEV (see src/platforms/esp/is_esp.h:68). The gate never fired — esp32dev compile still hit _ESPPIN<8, 256, false>::validpin() == false.
  2. Even with the right macro, only gating pin 8 isn't enough — classic ESP32's FASTLED_UNUSABLE_PIN_MASK covers pins {6, 7, 8, 9, 10, 11, 20} (SPI flash SD0/SD1/SD2/SD3/CMD/CLK pads + GPIO20). LegacyClocklessProxy iterates pins 0-8 so the SK6812/WS2812B instantiations on pins 6 and 7 were still failing the static_assert.

Fix

Introduce three macros — AUTORESEARCH_LEGACY_SUPPORTS_PIN_{6,7,8} — each gated by defined(FL_IS_ESP_32DEV). Classic ESP32 builds skip those three cases; every other family (including ESP32-S2/S3/C/H/P, Teensy, AVR, ARM, RP2040) keeps them.

Verification

bash compile esp32dev --examples AutoResearch --no-filter
→ SUCCESS: AutoResearch (01m:35s)

Previously failed with error: static assertion failed: This pin has been marked as an invalid pin for pins 6, 7, and 8 in sequence.

🤖 Generated with Claude Code

…low-up to #3447)

PR #3447 attempted to gate `case 8:` in `LegacyClocklessProxy` behind a
`#if defined(FL_IS_ESP_32) && !defined(<every variant>)` clause. Two
bugs:

1. `FL_IS_ESP_32` is not a real macro. The actual classic-ESP32 sentinel
   is `FL_IS_ESP_32DEV` (see `src/platforms/esp/is_esp.h:68`). The gate
   never fired, so esp32dev compile still hit
   `_ESPPIN<8, 256, false>::validpin() == false`.
2. Even with the right macro, only gating pin 8 isn't enough — classic
   ESP32's `FASTLED_UNUSABLE_PIN_MASK` covers pins {6, 7, 8, 9, 10, 11, 20}
   (SPI flash SD0/SD1/SD2/SD3/CMD/CLK pads + GPIO20). LegacyClocklessProxy
   iterates pins 0-8 so the SK6812/WS2812B instantiations on pins 6 and 7
   were still failing the static_assert.

Fix: introduce `AUTORESEARCH_LEGACY_SUPPORTS_PIN_{6,7,8}` macros, each
gated by `defined(FL_IS_ESP_32DEV)`. Classic ESP32 builds skip those
three cases; every other family (including ESP32-S2/S3/C/H/P, Teensy,
AVR, ARM, RP2040) keeps them.

Verified: `bash compile esp32dev --examples AutoResearch --no-filter`
now succeeds in 1m35s, where it previously failed with
`error: static assertion failed: This pin has been marked as an invalid
pin` for pins 6, 7, and 8 in sequence.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@zackees
zackees merged commit f4a537d into master Jun 30, 2026
6 checks passed
@zackees
zackees deleted the fix/3446-correct-esp32dev-macro branch June 30, 2026 19:12
@coderabbitai

coderabbitai Bot commented Jun 30, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/3446-correct-esp32dev-macro

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.

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