TJpg_Decoder icon indicating copy to clipboard operation
TJpg_Decoder copied to clipboard

Not work with FFat File system

Open fermintm opened this issue 1 year ago • 3 comments

Please add support for FFat filesystem ;)

fermintm avatar Jul 22 '24 12:07 fermintm

+1

JacobChrist avatar Sep 15 '25 20:09 JacobChrist

This mod to Tjpg_Decoder.h let's you use FFat:

   #if defined (ARDUINO_ARCH_ESP8266) || defined (ESP32)
     #include <pgmspace.h>
     #include <FS.h>
     #include <LittleFS.h>
     #ifdef ESP32
-       #include "SPIFFS.h" // ESP32 only
+      #if defined(USE_FFAT)
+        #include <FFat.h>
+        #define SPIFFS FFat
+      #else
+        #include "SPIFFS.h" // ESP32 only
+      #endif
     #endif
     #define TJPGD_LOAD_FFS
   #elif defined (ARDUINO_ARCH_RP2040) && defined (TJPGD_LOAD_FFS)
     #include <FS.h>
     #include <LittleFS.h>

Then you just need to add the following to define before you include the library:

#define USE_FFAT
#include <TJpg_Decoder.h>

This functionality brought to you by EarthLCD:

Image

JacobChrist avatar Sep 15 '25 22:09 JacobChrist

@Bodmer I would be happy to to a pull request for this change if you would accept it.

JacobChrist avatar Oct 01 '25 16:10 JacobChrist