Skip to content

Commit 17065df

Browse files
lbernstoneme-no-dev
authored andcommitted
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
1 parent 2f5b3c0 commit 17065df

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: libraries/SPIFFS/examples/SPIFFS_Test/SPIFFS_Test.ino

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#include "FS.h"
22
#include "SPIFFS.h"
33

4+
/* You only need to format SPIFFS the first time you run a
5+
test or else use the SPIFFS plugin to create a partition
6+
https://github.com/me-no-dev/arduino-esp32fs-plugin */
7+
#define FORMAT_SPIFFS_IF_FAILED true
8+
49
void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
510
Serial.printf("Listing directory: %s\r\n", dirname);
611

@@ -151,7 +156,7 @@ void testFileIO(fs::FS &fs, const char * path){
151156

152157
void setup(){
153158
Serial.begin(115200);
154-
if(!SPIFFS.begin()){
159+
if(!SPIFFS.begin(FORMAT_SPIFFS_IF_FAILED)){
155160
Serial.println("SPIFFS Mount Failed");
156161
return;
157162
}

0 commit comments

Comments
 (0)