summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/storage.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-01-27 23:11:59 +1100
committerDamien George <damien.p.george@gmail.com>2017-01-27 23:22:15 +1100
commit84c614e7290804e8b8d7ebff03ca35a4a4c5fcf1 (patch)
treebbe17048398f59f3ccfd79dac2da187897a67e60 /stmhal/storage.c
parent3242cf2d364b40fd26a643f1c618e8b51cef0139 (diff)
downloadmicropython-84c614e7290804e8b8d7ebff03ca35a4a4c5fcf1.tar.gz
micropython-84c614e7290804e8b8d7ebff03ca35a4a4c5fcf1.zip
stmhal: Convert to use VFS sub-system and new ooFatFs component.
This patch makes the following configuration changes: - MICROPY_FSUSERMOUNT is disabled, removing old mounting infrastructure - MICROPY_VFS is enabled, giving new VFS sub-system - MICROPY_VFS_FAT is enabled, giving uos.VfsFat type - MICROPY_FATFS_OO is enabled, to use new ooFatFs lib, R0.12b User facing API should be almost unchanged. Most notable changes are removal of os.mkfs (use os.VfsFat.mkfs instead) and pyb.mount doesn't allow unmounting by passing None as the device.
Diffstat (limited to 'stmhal/storage.c')
-rw-r--r--stmhal/storage.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/stmhal/storage.c b/stmhal/storage.c
index 60a7e9f480..6130d6fb8e 100644
--- a/stmhal/storage.c
+++ b/stmhal/storage.c
@@ -29,7 +29,8 @@
#include "py/obj.h"
#include "py/runtime.h"
-#include "lib/fatfs/ff.h"
+#include "lib/oofatfs/ff.h"
+#include "extmod/vfs_fat.h"
#include "extmod/fsusermount.h"
#include "systick.h"
@@ -504,7 +505,9 @@ const mp_obj_type_t pyb_flash_type = {
};
void pyb_flash_init_vfs(fs_user_mount_t *vfs) {
+ vfs->base.type = &mp_fat_vfs_type;
vfs->flags |= FSUSER_NATIVE | FSUSER_HAVE_IOCTL;
+ vfs->fatfs.drv = vfs;
vfs->readblocks[0] = (mp_obj_t)&pyb_flash_readblocks_obj;
vfs->readblocks[1] = (mp_obj_t)&pyb_flash_obj;
vfs->readblocks[2] = (mp_obj_t)storage_read_blocks; // native version