File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 4545// The root FS is always at the end of the list.
4646static fs_user_mount_t * get_vfs (int index ) {
4747 mp_vfs_mount_t * current_mount = MP_STATE_VM (vfs_mount_table );
48+ if (current_mount == NULL ) {
49+ return NULL ;
50+ }
4851 while (current_mount -> next != NULL ) {
4952 current_mount = current_mount -> next ;
5053 }
Original file line number Diff line number Diff line change @@ -294,7 +294,10 @@ const mp_obj_type_t internal_flash_type = {
294294};
295295
296296void flash_init_vfs (fs_user_mount_t * vfs ) {
297+ vfs -> base .type = & mp_fat_vfs_type ;
297298 vfs -> flags |= FSUSER_NATIVE | FSUSER_HAVE_IOCTL ;
299+ vfs -> fatfs .drv = vfs ;
300+ vfs -> fatfs .part = 1 ; // flash filesystem lives on first partition
298301 vfs -> readblocks [0 ] = (mp_obj_t )& internal_flash_obj_readblocks_obj ;
299302 vfs -> readblocks [1 ] = (mp_obj_t )& internal_flash_obj ;
300303 vfs -> readblocks [2 ] = (mp_obj_t )internal_flash_read_blocks ; // native version
You can’t perform that action at this time.
0 commit comments