File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ Wippersnapper_FS::Wippersnapper_FS() {
95
95
96
96
// If a filesystem does not already exist - attempt to initialize a new
97
97
// filesystem
98
- if (!initFilesystem ()) {
98
+ if (!initFilesystem () || ! initFilesystem ( true ) ) {
99
99
WS_DEBUG_PRINTLN (" ERROR Initializing Filesystem" );
100
100
setStatusLEDColor (RED);
101
101
while (1 )
@@ -123,13 +123,13 @@ Wippersnapper_FS::~Wippersnapper_FS() {}
123
123
@return True if filesystem initialized correctly, false otherwise.
124
124
*/
125
125
/* *************************************************************************/
126
- bool Wippersnapper_FS::initFilesystem () {
126
+ bool Wippersnapper_FS::initFilesystem (bool force_format ) {
127
127
// Init. flash library
128
128
if (!flash.begin ())
129
129
return false ;
130
130
131
131
// Check if FS exists
132
- if (!wipperFatFs.begin (&flash)) {
132
+ if (force_format || !wipperFatFs.begin (&flash)) {
133
133
// No filesystem exists - create a new FS
134
134
// NOTE: THIS WILL ERASE ALL DATA ON THE FLASH
135
135
if (!makeFilesystem ())
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ class Wippersnapper_FS {
44
44
Wippersnapper_FS ();
45
45
~Wippersnapper_FS ();
46
46
47
- bool initFilesystem ();
47
+ bool initFilesystem (bool force_format = false );
48
48
void initUSBMSC ();
49
49
50
50
void eraseCPFS ();
You can’t perform that action at this time.
0 commit comments