Skip to content

Commit b925914

Browse files
authored
Merge pull request espruino#380 from espruino/wilberforce-patch-2
Update formatting documentation
2 parents f574aae + 3348f36 commit b925914

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

boards/ESP32.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -520,10 +520,11 @@ This is defined in partitions_espruino.csv in the EspruinoBuildTools repository
520520
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:
521521

522522
```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');
527+
E.flashFatFS({ format: true });
527528
}
528529
```
529530

0 commit comments

Comments
 (0)