Repository navigation
refactor(boards): derive PARLIO flag emission from per-chip capability bit (#3304) - #3306
Conversation
…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
|
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 (2)
📝 WalkthroughWalkthroughAdds a ChangesPARLIO-Capable Board Refactor
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
Summary
parlio_capable: bool = Falseto theBoarddataclass;Board.to_platformio_ini()auto-prepends_ESP32_PARLIO_BUILD_FLAGSwhen set. Mirrors the existingmonitor_filtersauto-default pattern.parlio_capable=TrueonESP32_C5_DEVKITC_1,ESP32_C6_DEVKITC_1,ESP32H2,ESP32_P4and drop the manual*_ESP32_PARLIO_BUILD_FLAGSspread from those four boards.*_ESP32_PARLIO_BUILD_FLAGSspread fromESP32_S3_DEVKITC_1(S3 hasSOC_PARLIO_SUPPORTEDunset — the fix(esp32/parlio): CONFIG_PARLIO_TX_ISR_HANDLER_IN_IRAM=1 default in boards.py #3276 bug). Comment explicitly warns against regressing it.ci/tests/test_parlio_capable_boards.pypins theparlio_capableset to{esp32c5, esp32c6, esp32h2, esp32p4}, assertsesp32s3.to_platformio_ini()contains no PARLIO flag, and verifies everyparlio_capable=Trueboard emits both IRAM flags.The
_ESP32_PARLIO_BUILD_FLAGSconstant remains as the single source of truth for the two flag values; only the spread call sites moved.Closes #3304
Out of scope
parlio_capablefrom a vendored copy of ESP-IDF'ssoc_caps.h(the issue lists this as a stretch goal; deferred to a follow-up).Test plan
uv run pytest ci/tests/test_parlio_capable_boards.py -v— 4 tests, 4 subtests passuv run pytest ci/tests/test_board_to_platformio_ini.py -v— existing tests still passuv 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')"->OKbash lint— only pre-existingpython_pipeline FAILED(master-state, unrelated); no NEW lint failures introducedSummary by CodeRabbit
Bug Fixes
Tests
Chores