MCPcopy Create free account
hub / github.com/SmingHub/Sming / format

Method format

Sming/Libraries/Spiffs/src/FileSystem.cpp:196–210  ·  view source on GitHub ↗

* Format the file system and leave it mounted in an accessible state. */

Source from the content-addressed store, hash-verified

194 * Format the file system and leave it mounted in an accessible state.
195 */
196int FileSystem::format()
197{
198 spiffs_config cfg = fs.cfg;
199 // Must be unmounted before format is called - see API
200 SPIFFS_unmount(handle());
201 int err = SPIFFS_format(handle());
202 if(err < 0) {
203 err = translateSpiffsError(err);
204 debug_ifserr(err, "format()");
205 return err;
206 }
207
208 // Re-mount
209 return tryMount(cfg);
210}
211
212int FileSystem::check()
213{

Callers 1

spiffs_formatFunction · 0.45

Calls 1

translateSpiffsErrorFunction · 0.85

Tested by

no test coverage detected