You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: boards/ESP32.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -520,10 +520,11 @@ This is defined in partitions_espruino.csv in the EspruinoBuildTools repository
520
520
The last 1Mb has been defined as a flash FAT filesystem. It needs to be intialised for first use - this does it in a safe way that won't delete existing files:
521
521
522
522
```JavaScript
523
-
var fs =require('fs');
524
-
if ( typeof(fs.readdirSync()) ==='undefined' ) {
525
-
console.log('Formatting FS');
526
-
E.flashFatFS({ format:true });
523
+
try {
524
+
fs.readdirSync();
525
+
} catch (e) { //'Uncaught Error: Unable to mount media : NO_FILESYSTEM'
526
+
console.log('Formatting FS - only need to do once');
0 commit comments