extmod: Factor out block-device struct to make independent of fatfs.

This commit is contained in:
Damien George
2019-09-07 14:03:41 +10:00
parent ece4e21a55
commit 9aabb6c01b
10 changed files with 83 additions and 80 deletions

View File

@@ -161,7 +161,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(pyb_main_obj, 1, pyb_main);
MP_NOINLINE STATIC bool init_flash_fs(uint reset_mode) {
// init the vfs object
fs_user_mount_t *vfs_fat = &fs_user_mount_flash;
vfs_fat->flags = 0;
vfs_fat->blockdev.flags = 0;
pyb_flash_init_vfs(vfs_fat);
// try to mount the flash
@@ -230,7 +230,7 @@ STATIC bool init_sdcard_fs(void) {
if (vfs == NULL || vfs_fat == NULL) {
break;
}
vfs_fat->flags = FSUSER_FREE_OBJ;
vfs_fat->blockdev.flags = MP_BLOCKDEV_FLAG_FREE_OBJ;
sdcard_init_vfs(vfs_fat, part_num);
// try to mount the partition