From 17065dfd3a55f1e22cb770514a623057d4831724 Mon Sep 17 00:00:00 2001 From: lbernstone Date: Wed, 25 Jul 2018 09:44:37 -0700 Subject: [PATCH] Added a define to format the spiffs in SPIFFS_Test.ino (#1662) * Added a define to format the spiffs in SPIFFS_Test.ino * Uncommented the define * Matched define names --- libraries/SPIFFS/examples/SPIFFS_Test/SPIFFS_Test.ino | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/SPIFFS/examples/SPIFFS_Test/SPIFFS_Test.ino b/libraries/SPIFFS/examples/SPIFFS_Test/SPIFFS_Test.ino index 65b4859b..cfc111dc 100644 --- a/libraries/SPIFFS/examples/SPIFFS_Test/SPIFFS_Test.ino +++ b/libraries/SPIFFS/examples/SPIFFS_Test/SPIFFS_Test.ino @@ -1,6 +1,11 @@ #include "FS.h" #include "SPIFFS.h" +/* You only need to format SPIFFS the first time you run a + test or else use the SPIFFS plugin to create a partition + https://github.com/me-no-dev/arduino-esp32fs-plugin */ +#define FORMAT_SPIFFS_IF_FAILED true + void listDir(fs::FS &fs, const char * dirname, uint8_t levels){ Serial.printf("Listing directory: %s\r\n", dirname); @@ -151,7 +156,7 @@ void testFileIO(fs::FS &fs, const char * path){ void setup(){ Serial.begin(115200); - if(!SPIFFS.begin()){ + if(!SPIFFS.begin(FORMAT_SPIFFS_IF_FAILED)){ Serial.println("SPIFFS Mount Failed"); return; }