Repository navigation
docs(esp32): document capability-detection dispatch convention - #3730
Conversation
Codifies the pattern already used by pin_esp32_native.hpp
(FL_HAS_INCLUDE("driver/gpio.h") && FL_HAS_INCLUDE("driver/ledc.h")) as
the required convention for Arduino-vs-native dispatch, replacing the
#ifdef ARDUINO / #ifdef ARDUINO || FL_HAS_INCLUDE(<Arduino.h>) mix that
predated #3715: dispatch on whether the ESP-IDF driver header is
available, not on whether Arduino is the active framework, since
Arduino-ESP32 bundles the same ESP-IDF drivers.
Updates ARCHITECTURE.md's "No Environment Directories" decision record
(previously describing #ifdef ARDUINO as the accepted default) and adds
a pointer from agents/docs/cpp-standards.md's Platform Dispatch Headers
section.
Documents the two legitimate exceptions that don't need converting:
platform identification (is_esp.h's ARDUINO_ARCH_ESP32/ESP8266) and
host-mock selection (drivers/*/*_mock.cpp.hpp choosing device-vs-host,
not Arduino-vs-IDF).
Part of #3715. Closes #3722.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
|
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)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe PR updates ESP32 architecture and C++ standards documentation to require capability-based dispatch, document Arduino opt-in behavior, and define platform-identification and host-mock exceptions. ChangesESP32 dispatch documentation
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/platforms/esp/32/ARCHITECTURE.md`:
- Line 290: The documented Arduino opt-in contract does not match the
dispatcher’s current behavior. Update src/platforms/esp/32/ARCHITECTURE.md lines
290-290 to reference the actual defined(ARDUINO) && !defined(FL_NO_ARDUINO)
override in fastspi_esp32.h, and update agents/docs/cpp-standards.md lines 57-57
to use the same contract and guidance; do not document
FASTLED_ESP32_SPI_ARDUINO=1 unless the dispatcher is changed to honor it.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ccb21be7-520d-4726-85e5-57e438248c85
📒 Files selected for processing (2)
agents/docs/cpp-standards.mdsrc/platforms/esp/32/ARCHITECTURE.md
Matches the rename in #3727/#3718 (frozen FASTLED_* vocabulary rule). Addresses CodeRabbit review on #3730. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Closes #3722. Part of meta #3715 (ESP Arduino-decoupling).
Summary
Codifies the pattern already used by
pin_esp32_native.hpp(FL_HAS_INCLUDE("driver/gpio.h") && FL_HAS_INCLUDE("driver/ledc.h")) as the required convention for Arduino-vs-native dispatch on ESP32, replacingARCHITECTURE.md's prior "Decision #2" record which described plain#ifdef ARDUINOas the accepted default.Rule: dispatch on whether the ESP-IDF driver header you need is discoverable, not on whether Arduino is the active framework — Arduino-ESP32 bundles the same ESP-IDF drivers, so capability detection picks the IDF-native path under both Arduino and bare ESP-IDF, with Arduino APIs only reachable as an explicit opt-in.
Documents two legitimate exceptions that don't need converting (found while auditing the tree for this PR):
is_esp.h'sARDUINO_ARCH_ESP32/ARDUINO_ARCH_ESP8266identify chip family, not framework.drivers/*/*_mock.cpp.hppfiles guard on!ARDUINO && (linux/apple/win)to pick device-vs-host test-double, not Arduino-vs-IDF.Also notes that
io_esp.cpp.hpp'sFL_HAS_INCLUDE(<Arduino.h>)probe is already the correct pattern and needs no change — see #3720 (closed without a code change) for why a broader default flip there was rejected.Test plan
bash lint --cpp— clean (docs-only change)Summary by CodeRabbit
ARDUINOconditionals.