Skip to content

feat(i2s): re-include peripheral impl in unity build (#3512 Phase 5) - #3520

Merged
zackees merged 1 commit into
masterfrom
feat/i2s-phase5-unity-3512
Jul 1, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/i2s-phase5-unity-3512

Conversation

@zackees

@zackees zackees commented Jul 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Removes the UNITY_BUILD_EXCLUDE marker from i2s_peripheral_esp32dev_esp.cpp.hpp and adds the file to _build.cpp.hpp alphabetically.

Prior comment claimed the file's driver/gpio.h include triggered an ADC: CONFLICT! boot loop. Re-investigating: the actual conflict was driver/i2s.h in Stage 2 (#3476), NOT driver/gpio.h. The current Stage 4 impl doesn't include driver/i2s.h at all, so the conflict rationale no longer applies.

The stub transmit() currently does no DMA (#3512 Phase 2 does that work), so re-including adds a small TU that --gc-sections elides completely when unused.

Test plan

  • bash test --cpp: 344/344 pass
  • bash lint --cpp: clean (unity-build validates alphabetical order)
  • CI: esp32dev, esp32dev_i2s, esp32dev_idf6

Part of #3516 / #3512 Phase 5.

Summary by CodeRabbit

  • Bug Fixes
    • Updated ESP32 I2S build integration so the peripheral implementation is included correctly in the unified build.
    • Removed an outdated exclusion that was no longer needed, helping prevent missed functionality in builds.
    • Refreshed build notes to reflect the current conflict status and implementation behavior.

Removes the `UNITY_BUILD_EXCLUDE` marker from
`i2s_peripheral_esp32dev_esp.cpp.hpp` and adds the file to
`_build.cpp.hpp` alphabetically per unity-build convention.

## Why the exclude was wrong

Prior comment claimed the file's `driver/gpio.h` include triggered an
`ADC: CONFLICT!` boot loop when linked alongside the restored classic
Yves driver. Re-investigating: the actual conflict was `driver/i2s.h`
in the earlier Stage 2 (#3476) impl, NOT `driver/gpio.h`. Every other
classic-ESP32 driver in the tree (including `pin_esp32_native_impl.hpp`)
uses `driver/gpio.h` without triggering the conflict.

The current Stage 4 file drops `driver/i2s.h` entirely (see the file's
own docblock — only `esp_heap_caps.h` + `driver/gpio.h` remain), so the
conflict rationale no longer applies. The stub `transmit()` currently
does no DMA (see #3512 Phase 2 for that work), so re-including
adds a small TU that `--gc-sections` elides completely when nothing
calls into `I2sPeripheralEsp32DevEsp`.

## Verification

- `bash test --cpp`: 344/344 pass
- `bash lint --cpp`: clean (unity build validates the new include order
  alphabetically)

Part of #3516 / #3512 Phase 5.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@zackees
zackees merged commit a9e0117 into master Jul 1, 2026
7 of 10 checks passed
@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: 91bcc881-afb4-49e1-bc8a-3e0a46a4a631

📥 Commits

Reviewing files that changed from the base of the PR and between d236bca and 1353fd1.

📒 Files selected for processing (2)
  • src/platforms/esp/32/drivers/i2s/_build.cpp.hpp
  • src/platforms/esp/32/drivers/i2s/i2s_peripheral_esp32dev_esp.cpp.hpp

📝 Walkthrough

Walkthrough

This PR re-includes the i2s_peripheral_esp32dev_esp.cpp.hpp translation unit in the ESP32 I2S unity build, removing a previous UNITY_BUILD_EXCLUDE directive and updating build rationale comments in both files to explain that the earlier driver/i2s.h conflict no longer applies.

Changes

Unity Build Re-inclusion

Layer / File(s) Summary
Re-enable TU inclusion and update comments
src/platforms/esp/32/drivers/i2s/_build.cpp.hpp, src/platforms/esp/32/drivers/i2s/i2s_peripheral_esp32dev_esp.cpp.hpp
Removes the exclusion directive and adds the include for i2s_peripheral_esp32dev_esp.cpp.hpp in the unity build, updating comments to clarify the conflict was tied to a driver/i2s.h include no longer present, and notes the stub transmit() has no DMA and the TU is expected to be elided by --gc-sections.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#3476: Modifies the same _build.cpp.hpp unity-build inclusion and conflict comments for the same TU.
  • FastLED/FastLED#3478: Re-enables inclusion of the same Stage 4 i2s_peripheral_esp32dev_esp.cpp.hpp TU in _build.cpp.hpp.
  • FastLED/FastLED#3479: Reverts an earlier exclusion of the same peripheral TU in _build.cpp.hpp.
✨ 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/i2s-phase5-unity-3512

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.

zackees added a commit that referenced this pull request Jul 1, 2026
New `src/platforms/esp/32/drivers/i2s/README.md` documenting the
classic-ESP32 I2S parallel-out clockless driver as it stands today
(post #3479 restore + #3511/#3514 IDF6 compat +
#3518-#3520 selector cleanup + Phase 5 unity re-include).

Covers:

- **Files**: purpose of each `.h`/`.cpp.hpp` in the directory
- **User-facing binding today**: legacy `addLeds<>` via
  `-DFASTLED_ESP32_I2S=1` (production) vs modern channel-manager
  (not there yet — depends on Phase 4)
- **ESP-IDF version compat table**: IDF 4.x/5.x production; IDF 6.x
  compiles via the `i2s_periph_compat.h` shim (bench validation
  pending real WROOM + IDF 6 platform binding)
- **Streaming ISR DMA refill invariant**: the whole-point-of-I2S
  streaming pattern that any future refactor must preserve. Points at
  the ISR handler location and lists the three concrete guarantees.
- **Global state**: acknowledges the 10+ file-scope statics tracked
  under #3489, with the migration path via Phase 6.
- **Known bugs**: #1165 (`I2S_DEVICE=1` doesn't drive output)
  and #1384 (blocking `showPixels()`) with their respective
  fix paths through Phase 2 / Phase 4.
- **References**: cross-links to every open sub-issue, meta issue,
  and previous PR in the driver-dev umbrella.

Part of #3516 / #3512 Phase 8.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
@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
zackees deleted the feat/i2s-phase5-unity-3512 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.

1 participant