summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Needell <jerryneedell@gmail.com>2018-10-06 08:03:27 -0400
committerJerry Needell <jerryneedell@gmail.com>2018-10-06 08:03:27 -0400
commitfd0ea85549826e8daccdb534abc3e49610eff836 (patch)
tree884a2532070e4650a45c36f7fe145e1cb33d0135
parent7b95818c4f456736a8737e40c37d5555855f51a6 (diff)
add force_create to nrf filesystem_init()
-rw-r--r--ports/nrf/supervisor/filesystem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/nrf/supervisor/filesystem.c b/ports/nrf/supervisor/filesystem.c
index 1a3165a2d..b6611417d 100644
--- a/ports/nrf/supervisor/filesystem.c
+++ b/ports/nrf/supervisor/filesystem.c
@@ -36,7 +36,7 @@ static mp_vfs_mount_t _mp_vfs;
static fs_user_mount_t _internal_vfs;
-void filesystem_init(bool create_allowed) {
+void filesystem_init(bool create_allowed, bool force_create) {
// init the vfs object
fs_user_mount_t *int_vfs = &_internal_vfs;
int_vfs->flags = 0;
@@ -45,7 +45,7 @@ void filesystem_init(bool create_allowed) {
// try to mount the flash
FRESULT res = f_mount(&int_vfs->fatfs);
- if (res == FR_NO_FILESYSTEM && create_allowed) {
+ if ((res == FR_NO_FILESYSTEM && create_allowed) || force_create) {
// no filesystem so create a fresh one
uint8_t working_buf[_MAX_SS];
res = f_mkfs(&int_vfs->fatfs, FM_FAT | FM_SFD, 4096, working_buf, sizeof(working_buf));