Skip to content

Commit

Permalink
Should address:
Browse files Browse the repository at this point in the history
 issue 62 and 50
 possibly adresses settings corrupted by not formating the filesystem if it is
 formatted
 This possibly could lead to corruption

Fix Settings Corruption
Fixes mtongnz#50
Fixes Setting not saving / corruption
Should address corruption issues
Format of eprom logic was incorrect
  • Loading branch information
Michael Muller authored and ammuller committed Sep 22, 2017
1 parent d969ef5 commit 44406cd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions source/espArtnetNode_2.0.0_b5g.ino
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@ void setup(void) {
SPIFFS.begin();

// Check if SPIFFS formatted
if (SPIFFS.exists("/formatted.txt")) {
SPIFFS.format();
if (!SPIFFS.exists("/formatted.txt")) { // if formated.txt does not exits
SPIFFS.format(); // format the file system

File f = SPIFFS.open("/formatted.txt", "w");
f.print("Formatted");
f.close();
File f = SPIFFS.open("/formatted.txt", "w"); // open new file formatted.txt
f.print("Formatted"); // write "Formatted into file
f.close(); // save file
}

// Load our saved values or store defaults
Expand Down

1 comment on commit 44406cd

@zanglerecke
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think you are right ;)

Please sign in to comment.