From 707c2aa3bf61c7bf1121ca74dcd96e8d02ef6d93 Mon Sep 17 00:00:00 2001 From: MartinMueller2003 Date: Mon, 12 Feb 2024 09:09:05 -0500 Subject: [PATCH] Added write function Exposed unified littlefs type for use by our users. --- src/ESPUI.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ESPUI.h b/src/ESPUI.h index ceb4748..d02659a 100644 --- a/src/ESPUI.h +++ b/src/ESPUI.h @@ -117,6 +117,7 @@ public: void prepareFileSystem(bool format = true); // Initially preps the filesystem and loads a lot of // stuff into LITTLEFS void list(); // Lists LITTLEFS directory + void writeFile(const char* path, const char* data); uint16_t addControl(ControlType type, const char* label); uint16_t addControl(ControlType type, const char* label, const String& value); @@ -236,6 +237,16 @@ public: AsyncWebServer* WebServer() {return server;} AsyncWebSocket* WebSocket() {return ws;} +#if defined(ESP32) +# if (ESP_IDF_VERSION_MAJOR == 4 && ESP_IDF_VERSION_MINOR >= 4) || ESP_IDF_VERSION_MAJOR > 4 + fs::LittleFSFS & EspuiLittleFS = LittleFS; + #else + fs::LITTLEFSFS & EspuiLittleFS = LITTLEFS; +# endif +#else + fs::FS & EspuiLittleFS = LittleFS; +#endif + protected: friend class ESPUIclient; friend class ESPUIcontrol;