mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-24 11:46:34 +00:00
Add support for LittleFS
This commit is contained in:
parent
a3ce092f59
commit
23448f3c86
@ -1,12 +1,30 @@
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include <Arduino.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef ESP32
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP32)
|
||||
#if HASP_USE_SPIFFS > 0
|
||||
#include "SPIFFS.h"
|
||||
#elif HASP_USE_LITTLEFS > 0
|
||||
#include "LITTLEFS.h"
|
||||
#endif
|
||||
#elif defined(ARDUINO_ARCH_ESP8266)
|
||||
// included by default
|
||||
#endif // ARDUINO_ARCH
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
|
||||
#include <FS.h>
|
||||
#include <Esp.h>
|
||||
|
||||
#if HASP_USE_SPIFFS > 0
|
||||
#define FS SPIFFS
|
||||
#elif HASP_USE_LITTLEFS > 0
|
||||
#define FS LITTLEFS
|
||||
#endif // HASP_USE
|
||||
#endif // ARDUINO_ARCH
|
||||
|
||||
#include "lvgl.h"
|
||||
#include "lv_misc/lv_debug.h"
|
||||
@ -79,7 +97,7 @@ static inline bool openFont(File & file, const char * filename)
|
||||
{
|
||||
if(*filename != '/') return false;
|
||||
|
||||
file = SPIFFS.open(filename, "r");
|
||||
file = FS.open(filename, "r");
|
||||
if(!file) {
|
||||
Log.error(TAG_FONT, F("Opening font: %s"), filename);
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user