Skip to content

Commit 1228594

Browse files
authored
Merge pull request #1245 from jerryneedell/jerryn_erase
add force_create to nrf filesystem_init()
2 parents 7b95818 + fd0ea85 commit 1228594

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ports/nrf/supervisor/filesystem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static mp_vfs_mount_t _mp_vfs;
3636
static fs_user_mount_t _internal_vfs;
3737

3838

39-
void filesystem_init(bool create_allowed) {
39+
void filesystem_init(bool create_allowed, bool force_create) {
4040
// init the vfs object
4141
fs_user_mount_t *int_vfs = &_internal_vfs;
4242
int_vfs->flags = 0;
@@ -45,7 +45,7 @@ void filesystem_init(bool create_allowed) {
4545
// try to mount the flash
4646
FRESULT res = f_mount(&int_vfs->fatfs);
4747

48-
if (res == FR_NO_FILESYSTEM && create_allowed) {
48+
if ((res == FR_NO_FILESYSTEM && create_allowed) || force_create) {
4949
// no filesystem so create a fresh one
5050
uint8_t working_buf[_MAX_SS];
5151
res = f_mkfs(&int_vfs->fatfs, FM_FAT | FM_SFD, 4096, working_buf, sizeof(working_buf));

0 commit comments

Comments
 (0)