File tree 2 files changed +6
-0
lines changed 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 45
45
// The root FS is always at the end of the list.
46
46
static fs_user_mount_t * get_vfs (int index ) {
47
47
mp_vfs_mount_t * current_mount = MP_STATE_VM (vfs_mount_table );
48
+ if (current_mount == NULL ) {
49
+ return NULL ;
50
+ }
48
51
while (current_mount -> next != NULL ) {
49
52
current_mount = current_mount -> next ;
50
53
}
Original file line number Diff line number Diff line change @@ -294,7 +294,10 @@ const mp_obj_type_t internal_flash_type = {
294
294
};
295
295
296
296
void flash_init_vfs (fs_user_mount_t * vfs ) {
297
+ vfs -> base .type = & mp_fat_vfs_type ;
297
298
vfs -> flags |= FSUSER_NATIVE | FSUSER_HAVE_IOCTL ;
299
+ vfs -> fatfs .drv = vfs ;
300
+ vfs -> fatfs .part = 1 ; // flash filesystem lives on first partition
298
301
vfs -> readblocks [0 ] = (mp_obj_t )& internal_flash_obj_readblocks_obj ;
299
302
vfs -> readblocks [1 ] = (mp_obj_t )& internal_flash_obj ;
300
303
vfs -> readblocks [2 ] = (mp_obj_t )internal_flash_read_blocks ; // native version
You can’t perform that action at this time.
0 commit comments