Skip to content

Commit b5db18d

Browse files
committed
Added a define to format the spiffs in SPIFFS_Test.ino
1 parent e157ec0 commit b5db18d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

libraries/SPIFFS/examples/SPIFFS_Test/SPIFFS_Test.ino

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#include "FS.h"
22
#include "SPIFFS.h"
33

4+
// Format SPIFFS the first time you run a test
5+
// or else use the SPIFFS plugin to create a partition
6+
// https://github.com/me-no-dev/arduino-esp32fs-plugin
7+
//#define FORMAT_SPIFFS 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)){
155160
Serial.println("SPIFFS Mount Failed");
156161
return;
157162
}

0 commit comments

Comments
 (0)