FastLED 3.10.6
Loading...
Searching...
No Matches
embedded_fs.h File Reference

Detailed Description

Storage built into the microcontroller itself.

"Embedded" here names where the bytes live — on-chip flash, no card, no wiring — not which filesystem driver puts them there. That choice is the platform's: LittleFS on ESP32 and ESP8266, and other backends as they are added. A sketch never says "LittleFS", the same way it never says "SdFat" to use an SD card (FastLED #4007).

Usage — pair it with the generic seam FileSystem already exposes:

fl::ifstream f = fs.openRead("data/frame.rgb");
}
fl::ifstream openRead(const char *path)
Definition fs.cpp.hpp:170
bool begin(FsImplPtr platform_filesystem)
Definition fs.cpp.hpp:96
FsImplPtr getEmbeddedFs(bool format_on_fail) FL_NO_EXCEPT
Filesystem backed by the microcontroller's own flash, or null where the platform has none.

Returns null on platforms with no embedded storage, so the call is safe to make unconditionally and the failure surfaces at begin() rather than at link time.

Tree-shaking: the body lives in embedded_fs.cpp.hpp, compiled into its own translation unit (src/fl/build/fl.fs.embedded+.cpp). A sketch that never calls getEmbeddedFs() never references that TU, so the linker drops it and the whole filesystem chain with it — the same mechanism that keeps the SD chain out of non-SD sketches (#2773).

Definition in file embedded_fs.h.

#include "fl/stl/noexcept.h"
#include "fl/fs/fs.h"
+ Include dependency graph for embedded_fs.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  fl
 Base definition for an LED controller.
 

Functions

FsImplPtr fl::getEmbeddedFs (bool format_on_fail=false) FL_NO_EXCEPT
 Filesystem backed by the microcontroller's own flash, or null where the platform has none.