File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -106,9 +106,18 @@ Wippersnapper_FS::Wippersnapper_FS() {
106
106
107
107
// If a filesystem does not already exist - attempt to initialize a new
108
108
// filesystem
109
- if (!initFilesystem ()){ // } && !initFilesystem(true)) {
110
- setStatusLEDColor (RED);
111
- fsHalt (" ERROR Initializing Filesystem" );
109
+ if (!initFilesystem ()) {
110
+ if (WS.brownOutCausedReset ) {
111
+ // try once more for good measure
112
+ delay (10 ); // let power stablise after failure
113
+ if (!initFilesystem ()) {
114
+ // no lights, save power as we're probably on a low battery
115
+ fsHalt (" Brownout detected. Couldn't initialise filesystem." );
116
+ }
117
+ } else if (!WS.brownOutCausedReset && !initFilesystem (true )) {
118
+ setStatusLEDColor (RED);
119
+ fsHalt (" ERROR Initializing Filesystem" );
120
+ }
112
121
}
113
122
114
123
// Initialize USB-MSD
You can’t perform that action at this time.
0 commit comments