Skip to content

refactor(boards): derive PARLIO flag emission from per-chip capability bit (#3304) - #3306

Merged
zackees merged 1 commit into
masterfrom
feat/boards-parlio-from-soc
Jun 20, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/boards-parlio-from-soc

Conversation

@zackees

@zackees zackees commented Jun 20, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add parlio_capable: bool = False to the Board dataclass; Board.to_platformio_ini() auto-prepends _ESP32_PARLIO_BUILD_FLAGS when set. Mirrors the existing monitor_filters auto-default pattern.
  • Set parlio_capable=True on ESP32_C5_DEVKITC_1, ESP32_C6_DEVKITC_1, ESP32H2, ESP32_P4 and drop the manual *_ESP32_PARLIO_BUILD_FLAGS spread from those four boards.
  • Remove the bogus *_ESP32_PARLIO_BUILD_FLAGS spread from ESP32_S3_DEVKITC_1 (S3 has SOC_PARLIO_SUPPORTED unset — the fix(esp32/parlio): CONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM=1 default in boards.py #3276 bug). Comment explicitly warns against regressing it.
  • New snapshot test ci/tests/test_parlio_capable_boards.py pins the parlio_capable set to {esp32c5, esp32c6, esp32h2, esp32p4}, asserts esp32s3.to_platformio_ini() contains no PARLIO flag, and verifies every parlio_capable=True board emits both IRAM flags.

The _ESP32_PARLIO_BUILD_FLAGS constant remains as the single source of truth for the two flag values; only the spread call sites moved.

Closes #3304

Out of scope

Test plan

  • uv run pytest ci/tests/test_parlio_capable_boards.py -v — 4 tests, 4 subtests pass
  • uv run pytest ci/tests/test_board_to_platformio_ini.py -v — existing tests still pass
  • uv run python -c "from ci.boards import ESP32_S3_DEVKITC_1, ESP32_C6_DEVKITC_1; assert 'PARLIO' not in str(ESP32_S3_DEVKITC_1.to_platformio_ini()); assert 'PARLIO' in str(ESP32_C6_DEVKITC_1.to_platformio_ini()); print('OK')" -> OK
  • bash lint — only pre-existing python_pipeline FAILED (master-state, unrelated); no NEW lint failures introduced

Summary by CodeRabbit

  • Bug Fixes

    • Corrected PARLIO peripheral support detection for ESP32 board variants.
  • Tests

    • Added validation tests for PARLIO-capable board configurations.
  • Chores

    • Streamlined build flag configuration for boards with PARLIO support.

…y bit (#3304)

The PARLIO IRAM build flags (CONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM,
CONFIG_PARLIO_TX_ISR_CACHE_SAFE) in ci/boards.py were applied via a
hand-maintained allowlist that spread _ESP32_PARLIO_BUILD_FLAGS into each
PARLIO-capable board's build_flags. PR #3276 originally included esp32s3
in that list incorrectly — S3 has no PARLIO peripheral (SOC_PARLIO_SUPPORTED
is unset in its soc_caps.h) — and that bug shipped to master.

Switch to a capability-driven model that mirrors the existing
auto-detection pattern used for ESP32 monitor_filters:

- Add `parlio_capable: bool = False` to the Board dataclass, documented
  to track Espressif's SOC_PARLIO_SUPPORTED capability bit and to be
  kept in sync with src/platforms/esp/32/drivers/parlio/bus_traits.h:6.
- Auto-prepend _ESP32_PARLIO_BUILD_FLAGS in Board.to_platformio_ini()
  when parlio_capable is True. The constant stays as the single source
  of truth for the two flag values.
- Set parlio_capable=True on ESP32_C5_DEVKITC_1, ESP32_C6_DEVKITC_1,
  ESP32H2, ESP32_P4 and drop the manual spread from their build_flags.
- Remove the bogus *_ESP32_PARLIO_BUILD_FLAGS spread from
  ESP32_S3_DEVKITC_1 (the #3276 bug) and add a comment warning against
  regressing it.

Add a snapshot test (ci/tests/test_parlio_capable_boards.py) that pins:
- The parlio_capable set equals {esp32c5, esp32c6, esp32h2, esp32p4}.
- esp32s3.to_platformio_ini() contains no PARLIO flag.
- Every parlio_capable board's ini carries both IRAM flags.

Out of scope (per #3304): auto-deriving from a parsed copy of ESP-IDF's
soc_caps.h is deferred to a follow-up.

Closes #3304
@coderabbitai

coderabbitai Bot commented Jun 20, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cfc0b29e-688c-4cc4-bd97-3716ac28249d

📥 Commits

Reviewing files that changed from the base of the PR and between ee842e5 and 06a7fec.

📒 Files selected for processing (2)
  • ci/boards.py
  • ci/tests/test_parlio_capable_boards.py

📝 Walkthrough

Walkthrough

Adds a parlio_capable: bool field to the Board dataclass in ci/boards.py. Board.to_platformio_ini() now auto-injects _ESP32_PARLIO_BUILD_FLAGS when the field is set, replacing manual per-board flag spreading. Four board definitions are updated accordingly, and a new snapshot test locks down the canonical PARLIO-capable board set.

Changes

PARLIO-Capable Board Refactor

Layer / File(s) Summary
Board.parlio_capable field and to_platformio_ini() injection
ci/boards.py
Board gains parlio_capable: bool = False tied to SOC_PARLIO_SUPPORTED=1. to_platformio_ini() conditionally appends _ESP32_PARLIO_BUILD_FLAGS when the field is true, removing the need for per-board manual flag spreading.
ESP32 board definition updates
ci/boards.py
ESP32_C5_DEVKITC_1 and ESP32_P4 switch from board-local build_flags spreads to parlio_capable=True. ESP32_C6_DEVKITC_1 adds parlio_capable=True and drops its explicit _ESP32_PARLIO_BUILD_FLAGS spread. ESP32_S3_DEVKITC_1 is corrected to omit parlio_capable and removes its previously included PARLIO flags.
Snapshot test suite
ci/tests/test_parlio_capable_boards.py
New TestParlioCapableBoards suite asserts the PARLIO-capable board-family set matches exactly {esp32c5, esp32c6, esp32h2, esp32p4}, that esp32s3 is not flagged, that esp32s3's generated ini omits CONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM, and that every parlio_capable board's ini contains both required ISR flags.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#3276: Both PRs modify ci/boards.py targeting the same ESP32 boards and CONFIG_PARLIO_TX_ISR_* flags; this PR refactors that PR's direct _ESP32_PARLIO_BUILD_FLAGS spread into the parlio_capable-driven injection path.
  • FastLED/FastLED#2515: This PR's automated PARLIO flag injection via parlio_capable directly enables the PARLIO driver code paths introduced in the retrieved PR.
  • FastLED/FastLED#3290: Generates staged platformio.ini from Board.to_platformio_ini(), so this PR's new parlio_capable injection changes which CONFIG_PARLIO_* flags appear in that synthesized output.

Poem

🐇 Hoppity-hop through the chip family tree,
No more hand lists — parlio_capable=True sets flags free!
S3 stepped out, C5 and P4 stepped in,
The snapshot test guards what the capable boards win.
One field to rule them all, no more manual sin! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: refactoring PARLIO flag emission to be derived from a capability field rather than manual spreads.
Linked Issues check ✅ Passed The PR successfully implements all key objectives: adds parlio_capable field, sets it on C5/C6/H2/P4 boards, auto-applies flags in to_platformio_ini(), removes manual spreads, removes flags from S3, and includes a snapshot test verifying the capability set.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the PARLIO capability refactoring: Board dataclass modification, board definition updates, and related test coverage with no extraneous changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 feat/boards-parlio-from-soc

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 and usage tips.

@zackees
zackees merged commit 7768765 into master Jun 20, 2026
11 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 20, 2026
@zackees
zackees deleted the feat/boards-parlio-from-soc branch August 21, 2026 19:15
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.

boards.py: derive PARLIO-capable board list from SOC_PARLIO_SUPPORTED, not a hand-maintained list

1 participant