diff options
Diffstat (limited to 'atmel-samd/common-hal/storage/__init__.c')
| -rw-r--r-- | atmel-samd/common-hal/storage/__init__.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/atmel-samd/common-hal/storage/__init__.c b/atmel-samd/common-hal/storage/__init__.c index b7c4fa6dd..8a739bb8d 100644 --- a/atmel-samd/common-hal/storage/__init__.c +++ b/atmel-samd/common-hal/storage/__init__.c @@ -27,8 +27,10 @@ #include <string.h> #include "flash_api.h" +#include "main.h" #include "py/mperrno.h" #include "py/runtime.h" +#include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/storage/__init__.h" extern volatile bool mp_msc_enabled; @@ -44,3 +46,9 @@ void common_hal_storage_remount(const char* mount_path, bool readonly) { flash_set_usb_writeable(readonly); } + +void common_hal_storage_erase_filesystem(void) { + init_flash_fs(false, true); // Force a re-format. + common_hal_mcu_reset(); + // We won't actually get here, since we're resetting. +} |
