diff --git a/CMakeLists.txt b/CMakeLists.txt index 895b1b22..ab08dc74 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,7 +55,7 @@ set(LIBRARY_SRCS libraries/FS/src/vfs_api.cpp libraries/HTTPClient/src/HTTPClient.cpp libraries/HTTPUpdate/src/HTTPUpdate.cpp - libraries/LITTLEFS/src/LITTLEFS.cpp + libraries/LittleFS/src/LittleFS.cpp libraries/NetBIOS/src/NetBIOS.cpp libraries/Preferences/src/Preferences.cpp libraries/RainMaker/src/RMaker.cpp @@ -140,7 +140,7 @@ set(includedirs libraries/FS/src libraries/HTTPClient/src libraries/HTTPUpdate/src - libraries/LITTLEFS/src + libraries/LittleFS/src libraries/NetBIOS/src libraries/Preferences/src libraries/RainMaker/src diff --git a/libraries/LITTLEFS/examples/LITTLEFS_PlatformIO/.gitignore b/libraries/LittleFS/examples/LITTLEFS_PlatformIO/.gitignore similarity index 100% rename from libraries/LITTLEFS/examples/LITTLEFS_PlatformIO/.gitignore rename to libraries/LittleFS/examples/LITTLEFS_PlatformIO/.gitignore diff --git a/libraries/LITTLEFS/examples/LITTLEFS_PlatformIO/README.md b/libraries/LittleFS/examples/LITTLEFS_PlatformIO/README.md similarity index 100% rename from libraries/LITTLEFS/examples/LITTLEFS_PlatformIO/README.md rename to libraries/LittleFS/examples/LITTLEFS_PlatformIO/README.md diff --git a/libraries/LITTLEFS/examples/LITTLEFS_PlatformIO/data/file1.txt b/libraries/LittleFS/examples/LITTLEFS_PlatformIO/data/file1.txt similarity index 100% rename from libraries/LITTLEFS/examples/LITTLEFS_PlatformIO/data/file1.txt rename to libraries/LittleFS/examples/LITTLEFS_PlatformIO/data/file1.txt diff --git a/libraries/LITTLEFS/examples/LITTLEFS_PlatformIO/data/testfolder/test2.txt b/libraries/LittleFS/examples/LITTLEFS_PlatformIO/data/testfolder/test2.txt similarity index 100% rename from libraries/LITTLEFS/examples/LITTLEFS_PlatformIO/data/testfolder/test2.txt rename to libraries/LittleFS/examples/LITTLEFS_PlatformIO/data/testfolder/test2.txt diff --git a/libraries/LITTLEFS/examples/LITTLEFS_PlatformIO/include/.placeholder.txt b/libraries/LittleFS/examples/LITTLEFS_PlatformIO/include/.placeholder.txt similarity index 100% rename from libraries/LITTLEFS/examples/LITTLEFS_PlatformIO/include/.placeholder.txt rename to libraries/LittleFS/examples/LITTLEFS_PlatformIO/include/.placeholder.txt diff --git a/libraries/LITTLEFS/examples/LITTLEFS_PlatformIO/lib/.placeholder.txt b/libraries/LittleFS/examples/LITTLEFS_PlatformIO/lib/.placeholder.txt similarity index 100% rename from libraries/LITTLEFS/examples/LITTLEFS_PlatformIO/lib/.placeholder.txt rename to libraries/LittleFS/examples/LITTLEFS_PlatformIO/lib/.placeholder.txt diff --git a/libraries/LITTLEFS/examples/LITTLEFS_PlatformIO/littlefsbuilder.py b/libraries/LittleFS/examples/LITTLEFS_PlatformIO/littlefsbuilder.py similarity index 100% rename from libraries/LITTLEFS/examples/LITTLEFS_PlatformIO/littlefsbuilder.py rename to libraries/LittleFS/examples/LITTLEFS_PlatformIO/littlefsbuilder.py diff --git a/libraries/LITTLEFS/examples/LITTLEFS_PlatformIO/partitions_custom.csv b/libraries/LittleFS/examples/LITTLEFS_PlatformIO/partitions_custom.csv similarity index 100% rename from libraries/LITTLEFS/examples/LITTLEFS_PlatformIO/partitions_custom.csv rename to libraries/LittleFS/examples/LITTLEFS_PlatformIO/partitions_custom.csv diff --git a/libraries/LITTLEFS/examples/LITTLEFS_PlatformIO/platformio.ini b/libraries/LittleFS/examples/LITTLEFS_PlatformIO/platformio.ini similarity index 100% rename from libraries/LITTLEFS/examples/LITTLEFS_PlatformIO/platformio.ini rename to libraries/LittleFS/examples/LITTLEFS_PlatformIO/platformio.ini diff --git a/libraries/LITTLEFS/examples/LITTLEFS_PlatformIO/src/main.cpp b/libraries/LittleFS/examples/LITTLEFS_PlatformIO/src/main.cpp similarity index 87% rename from libraries/LITTLEFS/examples/LITTLEFS_PlatformIO/src/main.cpp rename to libraries/LittleFS/examples/LITTLEFS_PlatformIO/src/main.cpp index fe601ef4..0fc275fc 100644 --- a/libraries/LITTLEFS/examples/LITTLEFS_PlatformIO/src/main.cpp +++ b/libraries/LittleFS/examples/LITTLEFS_PlatformIO/src/main.cpp @@ -1,9 +1,9 @@ #include #include "FS.h" -#include +#include #include -/* You only need to format LITTLEFS the first time you run a +/* You only need to format LittleFS the first time you run a test or else use the LITTLEFS plugin to create a partition https://github.com/lorol/arduino-esp32littlefs-plugin */ @@ -249,30 +249,30 @@ void testFileIO(fs::FS &fs, const char * path){ void setup(){ Serial.begin(115200); - if(!LITTLEFS.begin(FORMAT_LITTLEFS_IF_FAILED)){ - Serial.println("LITTLEFS Mount Failed"); + if(!LittleFS.begin(FORMAT_LITTLEFS_IF_FAILED)){ + Serial.println("LittleFS Mount Failed"); return; } - listDir(LITTLEFS, "/", 0); - createDir(LITTLEFS, "/mydir"); - writeFile(LITTLEFS, "/mydir/hello2.txt", "Hello2"); - //writeFile(LITTLEFS, "/mydir/newdir2/newdir3/hello3.txt", "Hello3"); - writeFile2(LITTLEFS, "/mydir/newdir2/newdir3/hello3.txt", "Hello3"); - listDir(LITTLEFS, "/", 3); - deleteFile(LITTLEFS, "/mydir/hello2.txt"); - //deleteFile(LITTLEFS, "/mydir/newdir2/newdir3/hello3.txt"); - deleteFile2(LITTLEFS, "/mydir/newdir2/newdir3/hello3.txt"); - removeDir(LITTLEFS, "/mydir"); - listDir(LITTLEFS, "/", 3); - writeFile(LITTLEFS, "/hello.txt", "Hello "); - appendFile(LITTLEFS, "/hello.txt", "World!\r\n"); - readFile(LITTLEFS, "/hello.txt"); - renameFile(LITTLEFS, "/hello.txt", "/foo.txt"); - readFile(LITTLEFS, "/foo.txt"); - deleteFile(LITTLEFS, "/foo.txt"); - testFileIO(LITTLEFS, "/test.txt"); - deleteFile(LITTLEFS, "/test.txt"); + listDir(LittleFS, "/", 0); + createDir(LittleFS, "/mydir"); + writeFile(LittleFS, "/mydir/hello2.txt", "Hello2"); + //writeFile(LittleFS, "/mydir/newdir2/newdir3/hello3.txt", "Hello3"); + writeFile2(LittleFS, "/mydir/newdir2/newdir3/hello3.txt", "Hello3"); + listDir(LittleFS, "/", 3); + deleteFile(LittleFS, "/mydir/hello2.txt"); + //deleteFile(LittleFS, "/mydir/newdir2/newdir3/hello3.txt"); + deleteFile2(LittleFS, "/mydir/newdir2/newdir3/hello3.txt"); + removeDir(LittleFS, "/mydir"); + listDir(LittleFS, "/", 3); + writeFile(LittleFS, "/hello.txt", "Hello "); + appendFile(LittleFS, "/hello.txt", "World!\r\n"); + readFile(LittleFS, "/hello.txt"); + renameFile(LittleFS, "/hello.txt", "/foo.txt"); + readFile(LittleFS, "/foo.txt"); + deleteFile(LittleFS, "/foo.txt"); + testFileIO(LittleFS, "/test.txt"); + deleteFile(LittleFS, "/test.txt"); Serial.println( "Test complete" ); } diff --git a/libraries/LITTLEFS/examples/LITTLEFS_test/.skip.esp32c3 b/libraries/LittleFS/examples/LITTLEFS_test/.skip.esp32c3 similarity index 100% rename from libraries/LITTLEFS/examples/LITTLEFS_test/.skip.esp32c3 rename to libraries/LittleFS/examples/LITTLEFS_test/.skip.esp32c3 diff --git a/libraries/LITTLEFS/examples/LITTLEFS_test/LITTLEFS_test.ino b/libraries/LittleFS/examples/LITTLEFS_test/LITTLEFS_test.ino similarity index 85% rename from libraries/LITTLEFS/examples/LITTLEFS_test/LITTLEFS_test.ino rename to libraries/LittleFS/examples/LITTLEFS_test/LITTLEFS_test.ino index 4d594ea9..a3b01453 100644 --- a/libraries/LITTLEFS/examples/LITTLEFS_test/LITTLEFS_test.ino +++ b/libraries/LittleFS/examples/LITTLEFS_test/LITTLEFS_test.ino @@ -1,8 +1,8 @@ #include #include "FS.h" -#include +#include -/* You only need to format LITTLEFS the first time you run a +/* You only need to format LittleFS the first time you run a test or else use the LITTLEFS plugin to create a partition https://github.com/lorol/arduino-esp32littlefs-plugin @@ -244,41 +244,41 @@ void setup(){ Serial.begin(115200); #ifdef TWOPART - if(!LITTLEFS.begin(FORMAT_LITTLEFS_IF_FAILED, "/lfs2", 5, "part2")){ + if(!LittleFS.begin(FORMAT_LITTLEFS_IF_FAILED, "/lfs2", 5, "part2")){ Serial.println("part2 Mount Failed"); return; } - appendFile(LITTLEFS, "/hello0.txt", "World0!\r\n"); - readFile(LITTLEFS, "/hello0.txt"); - LITTLEFS.end(); + appendFile(LittleFS, "/hello0.txt", "World0!\r\n"); + readFile(LittleFS, "/hello0.txt"); + LittleFS.end(); Serial.println( "Done with part2, work with the first lfs partition..." ); #endif - if(!LITTLEFS.begin(FORMAT_LITTLEFS_IF_FAILED)){ - Serial.println("LITTLEFS Mount Failed"); + if(!LittleFS.begin(FORMAT_LITTLEFS_IF_FAILED)){ + Serial.println("LittleFS Mount Failed"); return; } Serial.println( "SPIFFS-like write file to new path and delete it w/folders" ); - writeFile2(LITTLEFS, "/new1/new2/new3/hello3.txt", "Hello3"); - listDir(LITTLEFS, "/", 3); - deleteFile2(LITTLEFS, "/new1/new2/new3/hello3.txt"); + writeFile2(LittleFS, "/new1/new2/new3/hello3.txt", "Hello3"); + listDir(LittleFS, "/", 3); + deleteFile2(LittleFS, "/new1/new2/new3/hello3.txt"); - listDir(LITTLEFS, "/", 3); - createDir(LITTLEFS, "/mydir"); - writeFile(LITTLEFS, "/mydir/hello2.txt", "Hello2"); - listDir(LITTLEFS, "/", 1); - deleteFile(LITTLEFS, "/mydir/hello2.txt"); - removeDir(LITTLEFS, "/mydir"); - listDir(LITTLEFS, "/", 1); - writeFile(LITTLEFS, "/hello.txt", "Hello "); - appendFile(LITTLEFS, "/hello.txt", "World!\r\n"); - readFile(LITTLEFS, "/hello.txt"); - renameFile(LITTLEFS, "/hello.txt", "/foo.txt"); - readFile(LITTLEFS, "/foo.txt"); - deleteFile(LITTLEFS, "/foo.txt"); - testFileIO(LITTLEFS, "/test.txt"); - deleteFile(LITTLEFS, "/test.txt"); + listDir(LittleFS, "/", 3); + createDir(LittleFS, "/mydir"); + writeFile(LittleFS, "/mydir/hello2.txt", "Hello2"); + listDir(LittleFS, "/", 1); + deleteFile(LittleFS, "/mydir/hello2.txt"); + removeDir(LittleFS, "/mydir"); + listDir(LittleFS, "/", 1); + writeFile(LittleFS, "/hello.txt", "Hello "); + appendFile(LittleFS, "/hello.txt", "World!\r\n"); + readFile(LittleFS, "/hello.txt"); + renameFile(LittleFS, "/hello.txt", "/foo.txt"); + readFile(LittleFS, "/foo.txt"); + deleteFile(LittleFS, "/foo.txt"); + testFileIO(LittleFS, "/test.txt"); + deleteFile(LittleFS, "/test.txt"); Serial.println( "Test complete" ); } diff --git a/libraries/LITTLEFS/examples/LITTLEFS_test/partitions.csv b/libraries/LittleFS/examples/LITTLEFS_test/partitions.csv similarity index 100% rename from libraries/LITTLEFS/examples/LITTLEFS_test/partitions.csv rename to libraries/LittleFS/examples/LITTLEFS_test/partitions.csv diff --git a/libraries/LITTLEFS/examples/LITTLEFS_time/.skip.esp32c3 b/libraries/LittleFS/examples/LITTLEFS_time/.skip.esp32c3 similarity index 100% rename from libraries/LITTLEFS/examples/LITTLEFS_time/.skip.esp32c3 rename to libraries/LittleFS/examples/LITTLEFS_time/.skip.esp32c3 diff --git a/libraries/LITTLEFS/examples/LITTLEFS_time/LITTLEFS_time.ino b/libraries/LittleFS/examples/LITTLEFS_time/LITTLEFS_time.ino similarity index 95% rename from libraries/LITTLEFS/examples/LITTLEFS_time/LITTLEFS_time.ino rename to libraries/LittleFS/examples/LITTLEFS_time/LITTLEFS_time.ino index 3f03c227..038261b1 100644 --- a/libraries/LITTLEFS/examples/LITTLEFS_time/LITTLEFS_time.ino +++ b/libraries/LittleFS/examples/LITTLEFS_time/LITTLEFS_time.ino @@ -1,16 +1,16 @@ #include "FS.h" //#include "SPIFFS.h" -#include "LITTLEFS.h" +#include "LittleFS.h" #include #include -#define SPIFFS LITTLEFS +#define SPIFFS LittleFS /* This examples uses "quick re-define" of SPIFFS to run - an existing sketch with LITTLEFS instead of SPIFFS + an existing sketch with LittleFS instead of SPIFFS - You only need to format LITTLEFS the first time you run a - test or else use the LITTLEFS plugin to create a partition + You only need to format LittleFS the first time you run a + test or else use the LittleFS plugin to create a partition https://github.com/lorol/arduino-esp32littlefs-plugin */ #define FORMAT_LITTLEFS_IF_FAILED true @@ -169,7 +169,7 @@ void setup(){ Serial.println(""); if(!SPIFFS.begin(FORMAT_LITTLEFS_IF_FAILED)){ - Serial.println("LITTLEFS Mount Failed"); + Serial.println("LittleFS Mount Failed"); return; } diff --git a/libraries/LITTLEFS/library.properties b/libraries/LittleFS/library.properties similarity index 90% rename from libraries/LITTLEFS/library.properties rename to libraries/LittleFS/library.properties index dd82bfa5..562cfafe 100644 --- a/libraries/LITTLEFS/library.properties +++ b/libraries/LittleFS/library.properties @@ -1,4 +1,4 @@ -name=LITTLEFS +name=LittleFS version=2.0.0 author= maintainer= diff --git a/libraries/LITTLEFS/src/LITTLEFS.cpp b/libraries/LittleFS/src/LittleFS.cpp similarity index 78% rename from libraries/LITTLEFS/src/LITTLEFS.cpp rename to libraries/LittleFS/src/LittleFS.cpp index 5c101729..7989dcb6 100644 --- a/libraries/LITTLEFS/src/LITTLEFS.cpp +++ b/libraries/LittleFS/src/LittleFS.cpp @@ -22,7 +22,7 @@ extern "C" { #include } #include "sdkconfig.h" -#include "LITTLEFS.h" +#include "LittleFS.h" #ifdef CONFIG_LITTLEFS_PAGE_SIZE extern "C" { @@ -31,29 +31,29 @@ extern "C" { using namespace fs; -class LITTLEFSImpl : public VFSImpl +class LittleFSImpl : public VFSImpl { public: - LITTLEFSImpl(); - virtual ~LITTLEFSImpl() { } + LittleFSImpl(); + virtual ~LittleFSImpl() { } virtual bool exists(const char* path); }; -LITTLEFSImpl::LITTLEFSImpl() +LittleFSImpl::LittleFSImpl() { } -bool LITTLEFSImpl::exists(const char* path) +bool LittleFSImpl::exists(const char* path) { File f = open(path, "r"); return (f == true); } -LITTLEFSFS::LITTLEFSFS() : FS(FSImplPtr(new LITTLEFSImpl())), partitionLabel_(NULL) +LittleFSFS::LittleFSFS() : FS(FSImplPtr(new LittleFSImpl())), partitionLabel_(NULL) { } -LITTLEFSFS::~LITTLEFSFS() +LittleFSFS::~LittleFSFS() { if (partitionLabel_){ free(partitionLabel_); @@ -61,7 +61,7 @@ LITTLEFSFS::~LITTLEFSFS() } } -bool LITTLEFSFS::begin(bool formatOnFail, const char * basePath, uint8_t maxOpenFiles, const char * partitionLabel) +bool LittleFSFS::begin(bool formatOnFail, const char * basePath, uint8_t maxOpenFiles, const char * partitionLabel) { if (partitionLabel_){ @@ -74,7 +74,7 @@ bool LITTLEFSFS::begin(bool formatOnFail, const char * basePath, uint8_t maxOpen } if(esp_littlefs_mounted(partitionLabel_)){ - log_w("LITTLEFS Already Mounted!"); + log_w("LittleFS Already Mounted!"); return true; } @@ -91,38 +91,38 @@ bool LITTLEFSFS::begin(bool formatOnFail, const char * basePath, uint8_t maxOpen } } if(err != ESP_OK){ - log_e("Mounting LITTLEFS failed! Error: %d", err); + log_e("Mounting LittleFS failed! Error: %d", err); return false; } _impl->mountpoint(basePath); return true; } -void LITTLEFSFS::end() +void LittleFSFS::end() { if(esp_littlefs_mounted(partitionLabel_)){ esp_err_t err = esp_vfs_littlefs_unregister(partitionLabel_); if(err){ - log_e("Unmounting LITTLEFS failed! Error: %d", err); + log_e("Unmounting LittleFS failed! Error: %d", err); return; } _impl->mountpoint(NULL); } } -bool LITTLEFSFS::format() +bool LittleFSFS::format() { disableCore0WDT(); esp_err_t err = esp_littlefs_format(partitionLabel_); enableCore0WDT(); if(err){ - log_e("Formatting LITTLEFS failed! Error: %d", err); + log_e("Formatting LittleFS failed! Error: %d", err); return false; } return true; } -size_t LITTLEFSFS::totalBytes() +size_t LittleFSFS::totalBytes() { size_t total,used; if(esp_littlefs_info(partitionLabel_, &total, &used)){ @@ -131,7 +131,7 @@ size_t LITTLEFSFS::totalBytes() return total; } -size_t LITTLEFSFS::usedBytes() +size_t LittleFSFS::usedBytes() { size_t total,used; if(esp_littlefs_info(partitionLabel_, &total, &used)){ @@ -140,5 +140,5 @@ size_t LITTLEFSFS::usedBytes() return used; } -LITTLEFSFS LITTLEFS; +LittleFSFS LittleFS; #endif diff --git a/libraries/LITTLEFS/src/LITTLEFS.h b/libraries/LittleFS/src/LittleFS.h similarity index 90% rename from libraries/LITTLEFS/src/LITTLEFS.h rename to libraries/LittleFS/src/LittleFS.h index c76cc887..dbe45cb9 100644 --- a/libraries/LITTLEFS/src/LITTLEFS.h +++ b/libraries/LittleFS/src/LittleFS.h @@ -19,11 +19,11 @@ namespace fs { -class LITTLEFSFS : public FS +class LittleFSFS : public FS { public: - LITTLEFSFS(); - ~LITTLEFSFS(); + LittleFSFS(); + ~LittleFSFS(); bool begin(bool formatOnFail=false, const char * basePath="/littlefs", uint8_t maxOpenFiles=10, const char * partitionLabel="spiffs"); bool format(); size_t totalBytes(); @@ -36,7 +36,7 @@ private: } -extern fs::LITTLEFSFS LITTLEFS; +extern fs::LittleFSFS LittleFS; #endif