Repository navigation
fix(esp8266): probe <SPI.h> in the guard that admits the Arduino SD backend - #3815
Merged
Merged
Conversation
…ackend ESP8266 did not build at all: fs_sdcard_arduino.cpp.hpp:12:10: fatal error: SPI.h: No such file or directory The guard admitting this block tested <SD.h> and <fs.h>, then included <SPI.h> unconditionally a few lines later. ESP8266 satisfies the first two -- its core ships an unrelated <fs.h> for the flash filesystem, so the probe passes for a reason that has nothing to do with SD cards -- while SPI was not on the include path. The block was admitted and then failed on the one header the guard never checked. Add <SPI.h> to the condition. Every header a block includes has to be in the condition that admits it. Platforms that do have SPI.h are unaffected: this only adds a term that is already true for them. Platforms that lack it lose a block that could not compile there anyway. Verified locally: `bash compile esp8266 --examples ColorPalette` fails on master and succeeds here; `bash test --cpp` 359/359; `bash lint` clean. Co-Authored-By: Claude <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Arduino SD-card implementation guard now checks for ChangesArduino SD-card compatibility
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related PRs
✨ 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 |
This was referenced Aug 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ESP8266 does not build at all on master. Found while trying to compile an example to investigate #743.
Cause
src/fl/system/sd/fs_sdcard_arduino.cpp.hpp:9guarded the Arduino SD backend on two headers, then included a third unconditionally:ESP8266 satisfies both probed terms — and
<fs.h>for a reason that has nothing to do with SD cards, since the ESP8266 core ships its own unrelated<fs.h>for the flash filesystem. So the block was admitted, and then failed on the one header the guard never checked.Adding
<SPI.h>to the condition is the whole fix. Every header a block includes has to be in the condition that admits it.Blast radius is one-directional. This only adds a term that is already true on platforms that have
SPI.h, so they are unaffected. Platforms that lack it lose a block that could not compile there anyway.Validation (local, per the skip-GHA-for-src workflow)
bash compile esp8266 --examples ColorPaletteon masterfatal error: SPI.hbash compile esp8266 --examples ColorPaletteherebash test --cppbash lintContext: this was found investigating #743
#743 (2019) reports gradient palettes landing in RAM on ESP8266 because
FASTLED_USE_PROGMEMdefaults to0. While set up to check that, I confirmed the platform simply didn't compile.For the record, since it settles #743 — objdump on the linked ESP8266 image from this branch:
.irom0.textis flash. The palettes are not in RAM.The reason the setting says otherwise is that it is not consulted on ESP8266 at all.
src/fastled_progmem.h:8dispatches ondefined(ESP8266)before it ever testsFASTLED_USE_PROGMEM, soprogmem_esp8266.his included unconditionally and mapsFL_PROGMEM/FL_PGM_READ_*onto the realpgm_read_*accessors regardless of the value. Setting it to0or1does not move a byte. The reporter read# define FASTLED_USE_PROGMEM 0and drew the only reasonable conclusion from it.I did not correct that value here:
led_sysdefs_esp8266.his behind theprotect_platform_headershook, and overriding a deliberate guardrail for a documentation-grade change wants explicit sign-off rather than my judgement. Left as a note on #743 instead.🤖 Generated with Claude Code
Summary by CodeRabbit