Skip to content

Commit

Permalink
Added a define to format the spiffs in SPIFFS_Test.ino (#1662)
Browse files Browse the repository at this point in the history
* Added a define to format the spiffs in SPIFFS_Test.ino

* Uncommented the define

* Matched define names
  • Loading branch information
lbernstone authored and me-no-dev committed Jul 25, 2018
1 parent 2f5b3c0 commit 17065df
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libraries/SPIFFS/examples/SPIFFS_Test/SPIFFS_Test.ino
Original file line number Diff line number Diff line change
@@ -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);

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 17065df

Please sign in to comment.