diff options
| author | Damien George | 2017-01-27 17:17:54 +1100 |
|---|---|---|
| committer | Damien George | 2017-01-27 17:21:45 +1100 |
| commit | 6c23c7587f1c02f58e9246ec59fe4f6544728b50 (patch) | |
| tree | 14ab47dccc6e572fbe53f7b460d01d892c4daf53 /extmod/vfs_fat_misc.c | |
| parent | fb3ae1784e1905709f82aadb7f1c8994682f9759 (diff) | |
extmod/vfs: Add ability for VFS sub-system to import using VfsFat.
Diffstat (limited to 'extmod/vfs_fat_misc.c')
| -rw-r--r-- | extmod/vfs_fat_misc.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/extmod/vfs_fat_misc.c b/extmod/vfs_fat_misc.c index ea267a15f..489e53586 100644 --- a/extmod/vfs_fat_misc.c +++ b/extmod/vfs_fat_misc.c @@ -108,21 +108,17 @@ mp_obj_t fat_vfs_listdir2(fs_user_mount_t *vfs, const char *path, bool is_str_ty return dir_list; } -mp_import_stat_t fat_vfs_import_stat(const char *path); - -mp_import_stat_t fat_vfs_import_stat(const char *path) { +mp_import_stat_t fat_vfs_import_stat(fs_user_mount_t *vfs, const char *path) { FILINFO fno; #if !MICROPY_FATFS_OO && _USE_LFN fno.lfname = NULL; fno.lfsize = 0; #endif #if MICROPY_FATFS_OO - fs_user_mount_t *vfs = ff_get_vfs(&path); - if (vfs == NULL) { - return MP_IMPORT_STAT_NO_EXIST; - } + assert(vfs != NULL); FRESULT res = f_stat(&vfs->fatfs, path, &fno); #else + (void)vfs; FRESULT res = f_stat(path, &fno); #endif if (res == FR_OK) { |
