Skip to content

fix(teensy): privatize optional framework extras - #3710

Merged
zackees merged 7 commits into
masterfrom
feat/teensy-internal-extras
Jul 16, 2026
Merged

zackees merged 7 commits into
masterfrom
feat/teensy-internal-extras

Conversation

@zackees

@zackees zackees commented Jul 16, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Vendor the minimal PJRC Teensy I2S capture implementation under src/platforms/arm/teensy/audio/ and route FastLED audio through it.
  • Vendor a private SdFat FAT/SPI subset under src/platforms/arm/teensy/sdfat/, with lazy implementation-only singleton state.
  • Remove public-header discovery of external Audio.h, SD.h, and SdFat.h; move the generic Arduino SD implementation into an implementation-only translation unit.
  • Enforce fl::platforms namespaces for the private Teensy forks and teach bash bloat teensy41 to find fbuild artifacts.

Why

FastLED must not make a Blink sketch depend on framework Audio, SD, SdFat, or SerialFlash merely by including FastLED.h. The private forks eliminate FastLED-owned include paths and global objects that created those roots.

Validation

  • bash lint
  • bash test --cpp --debug - 355/355 passed
  • bash compile teensy41 --examples Blink - 100,352 B flash / 72,544 B RAM
  • bash compile teensy41 --examples hydropack --no-filter - 161,792 B flash / 85,152 B RAM

Dependency

Depends on FastLED/fbuild#1097 (sketch-rooted selection) and FastLED/fbuild#1098 (active conditional scanning). After both land, this PR will rerun the Teensy Blink build and symbol report to prove the final bloat reduction before #3696 is closed.

Refs #3696

Summary by CodeRabbit

  • New Features

    • Added Teensy I2S audio input support, including Teensy 4.x I2S2 configurations.
    • Added private Teensy SD-card filesystem support for FAT32 read operations, long filenames, and SPI cards.
    • Improved SD-card integration across supported Teensy boards.
  • Bug Fixes

    • Improved firmware size analysis by detecting newer build artifact layouts automatically.
    • Updated ESP32-S3 size baseline data.
  • Documentation

    • Clarified supported board and firmware artifact handling for size analysis.
    • Documented the bundled Teensy audio and SD-card components.

@coderabbitai

coderabbitai Bot commented Jul 16, 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: a46f4cbb-34d2-46c4-a0a1-b39c25d8f15b

📥 Commits

Reviewing files that changed from the base of the PR and between 3940ab1 and 50c472d.

📒 Files selected for processing (69)
  • agents/docs/binary-size-analysis.md
  • ci/bloat.py
  • ci/lint_cpp_rs/src/checkers/platform_policy.rs
  • src/fl/system/sd/_build.cpp.hpp
  • src/fl/system/sd/file_system_sd.cpp.hpp
  • src/fl/system/sd/fs_sdcard_arduino.cpp.hpp
  • src/fl/system/sd/fs_sdcard_arduino.h
  • src/platforms/arm/rp/rpcommon/_build.cpp.hpp
  • src/platforms/arm/teensy/_build.cpp.hpp
  • src/platforms/arm/teensy/audio/README.md
  • src/platforms/arm/teensy/audio/_build.cpp.hpp
  • src/platforms/arm/teensy/audio/pjrc_audio_stream.cpp.hpp
  • src/platforms/arm/teensy/audio/pjrc_audio_stream.h
  • src/platforms/arm/teensy/audio/pjrc_i2s_config.cpp.hpp
  • src/platforms/arm/teensy/audio/pjrc_i2s_config.h
  • src/platforms/arm/teensy/audio/pjrc_input_i2s.cpp.hpp
  • src/platforms/arm/teensy/audio/pjrc_input_i2s.h
  • src/platforms/arm/teensy/audio/pjrc_input_i2s2.cpp.hpp
  • src/platforms/arm/teensy/audio/pjrc_input_i2s2.h
  • src/platforms/arm/teensy/audio_input_teensy.cpp.hpp
  • src/platforms/arm/teensy/audio_input_teensy.h
  • src/platforms/arm/teensy/audio_input_teensy_config.h
  • src/platforms/arm/teensy/ldf_headers.h
  • src/platforms/arm/teensy/sdfat/FatLib/FatFile.cpp.hpp
  • src/platforms/arm/teensy/sdfat/FatLib/FatFile.h
  • src/platforms/arm/teensy/sdfat/FatLib/FatFileLFN.cpp.hpp
  • src/platforms/arm/teensy/sdfat/FatLib/FatLib.h
  • src/platforms/arm/teensy/sdfat/FatLib/FatName.cpp.hpp
  • src/platforms/arm/teensy/sdfat/FatLib/FatPartition.cpp.hpp
  • src/platforms/arm/teensy/sdfat/FatLib/FatPartition.h
  • src/platforms/arm/teensy/sdfat/FatLib/FatVolume.cpp.hpp
  • src/platforms/arm/teensy/sdfat/FatLib/FatVolume.h
  • src/platforms/arm/teensy/sdfat/FatLib/_build.cpp.hpp
  • src/platforms/arm/teensy/sdfat/README.md
  • src/platforms/arm/teensy/sdfat/SdCard/SdCardInfo.h
  • src/platforms/arm/teensy/sdfat/SdCard/SdCardInterface.h
  • src/platforms/arm/teensy/sdfat/SdCard/SdSpiCard.cpp.hpp
  • src/platforms/arm/teensy/sdfat/SdCard/SdSpiCard.h
  • src/platforms/arm/teensy/sdfat/SdCard/_build.cpp.hpp
  • src/platforms/arm/teensy/sdfat/SdFat.h
  • src/platforms/arm/teensy/sdfat/SdFatConfig.h
  • src/platforms/arm/teensy/sdfat/SpiDriver/SdSpiArduinoDriver.h
  • src/platforms/arm/teensy/sdfat/SpiDriver/SdSpiChipSelect.cpp.hpp
  • src/platforms/arm/teensy/sdfat/SpiDriver/SdSpiDriver.h
  • src/platforms/arm/teensy/sdfat/SpiDriver/SdSpiTeensy3.cpp.hpp
  • src/platforms/arm/teensy/sdfat/SpiDriver/_build.cpp.hpp
  • src/platforms/arm/teensy/sdfat/common/ArduinoFiles.h
  • src/platforms/arm/teensy/sdfat/common/CompileDateTime.h
  • src/platforms/arm/teensy/sdfat/common/DebugMacros.h
  • src/platforms/arm/teensy/sdfat/common/FmtNumber.cpp.hpp
  • src/platforms/arm/teensy/sdfat/common/FmtNumber.h
  • src/platforms/arm/teensy/sdfat/common/FsApiConstants.h
  • src/platforms/arm/teensy/sdfat/common/FsBlockDevice.h
  • src/platforms/arm/teensy/sdfat/common/FsBlockDeviceInterface.h
  • src/platforms/arm/teensy/sdfat/common/FsCache.cpp.hpp
  • src/platforms/arm/teensy/sdfat/common/FsCache.h
  • src/platforms/arm/teensy/sdfat/common/FsDateTime.cpp.hpp
  • src/platforms/arm/teensy/sdfat/common/FsDateTime.h
  • src/platforms/arm/teensy/sdfat/common/FsName.cpp.hpp
  • src/platforms/arm/teensy/sdfat/common/FsName.h
  • src/platforms/arm/teensy/sdfat/common/FsStructs.h
  • src/platforms/arm/teensy/sdfat/common/FsUtf.cpp.hpp
  • src/platforms/arm/teensy/sdfat/common/FsUtf.h
  • src/platforms/arm/teensy/sdfat/common/SysCall.h
  • src/platforms/arm/teensy/sdfat/common/_build.cpp.hpp
  • src/platforms/arm/teensy/sdfat/common/upcase.cpp.hpp
  • src/platforms/arm/teensy/sdfat/common/upcase.h
  • src/platforms/arm/teensy/sdfat/fs_sdfat_teensy.h
  • tests/data/esp32s3_bloat_baseline.txt

📝 Walkthrough

Walkthrough

Adds private Teensy PJRC I2S audio and SdFat filesystem implementations, integrates them into FastLED’s build and SD/audio paths, tightens namespace policy checks, and updates bloat-analysis ELF detection and baseline data.

Changes

Teensy platform support

Layer / File(s) Summary
Build and platform wiring
ci/bloat.py, ci/lint_cpp_rs/..., src/fl/system/sd/..., src/platforms/arm/teensy/_build.cpp.hpp, src/platforms/arm/teensy/ldf_headers.h
Adds fbuild-through-PIO ELF detection, stricter Teensy namespace validation, and unity-build wiring for the new audio and SdFat implementations.
Private Teensy I2S audio stack
src/platforms/arm/teensy/audio/*, src/platforms/arm/teensy/audio_input_teensy.*
Adds PJRC-derived audio stream management, DMA-backed I2S/I2S2 input, clock configuration, audio connections, and FastLED-specific wrapper integration.
SdFat filesystem stack
src/platforms/arm/teensy/sdfat/FatLib/*, src/platforms/arm/teensy/sdfat/common/*
Adds private FAT partition, volume, file, long-name, UTF, cache, formatting, and date/time support.
SD card and SPI backend
src/platforms/arm/teensy/sdfat/SdCard/*, src/platforms/arm/teensy/sdfat/SpiDriver/*, src/platforms/arm/teensy/sdfat/SdFat*
Adds SD card metadata and SPI read/write implementations, configuration interfaces, and the SdFat32 facade.
SD filesystem integration
src/platforms/arm/teensy/sdfat/fs_sdfat_teensy.h, src/fl/system/sd/*
Adds the Teensy filesystem factory and file-handle wrapper, and selects it for Teensy SD support.
Supporting updates
src/platforms/arm/rp/rpcommon/_build.cpp.hpp, tests/data/esp32s3_bloat_baseline.txt
Reorders RP unity-build includes and updates the ESP32-S3 bloat baseline.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related issues

Possibly related PRs

✨ 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/teensy-internal-extras

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
zackees marked this pull request as ready for review July 16, 2026 16:55
@zackees
zackees merged commit bfd2888 into master Jul 16, 2026
10 of 11 checks passed
@zackees
zackees deleted the feat/teensy-internal-extras branch July 16, 2026 16:55
@fastled-project-sync fastled-project-sync Bot moved this from In Progress to Triage in FastLED Tracker Jul 16, 2026
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jul 16, 2026
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