MCPcopy Create free account
hub / github.com/FastLED/FastLED / loadJpegFromSD

Function loadJpegFromSD

src/fl/system/file_system.h:108–120  ·  view source on GitHub ↗

Standalone helper function to load JPEG from SD card Combines SD card initialization and JPEG loading in one convenient function

Source from the content-addressed store, hash-verified

106// Standalone helper function to load JPEG from SD card
107// Combines SD card initialization and JPEG loading in one convenient function
108inline FramePtr loadJpegFromSD(int cs_pin, const char *filepath,
109 const JpegConfig &config = JpegConfig(),
110 fl::string *error_message = nullptr) {
111 FileSystem fs;
112 if (!fs.beginSd(cs_pin)) {
113 if (error_message) {
114 *error_message = "Failed to initialize SD card on CS pin ";
115 error_message->append(static_cast<fl::u32>(cs_pin));
116 }
117 return FramePtr();
118 }
119 return fs.loadJpeg(filepath, config, error_message);
120}
121
122} // namespace fl

Callers

nothing calls this directly

Calls 4

JpegConfigClass · 0.85
beginSdMethod · 0.80
loadJpegMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected