Skip to content

Commit 643876f

Browse files
committed
extmod/vfs_fat: Allow to compile with MICROPY_VFS_FAT disabled.
Some ports may want to compile with generic MICROPY_VFS support but without the VfsFat class. This patch allows such a thing.
1 parent f5aac7d commit 643876f

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

extmod/vfs_fat_diskio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*/
2929

3030
#include "py/mpconfig.h"
31-
#if MICROPY_VFS
31+
#if MICROPY_VFS && MICROPY_VFS_FAT
3232

3333
#include <stdint.h>
3434
#include <stdio.h>
@@ -277,4 +277,4 @@ DRESULT disk_ioctl (
277277
}
278278
}
279279

280-
#endif // MICROPY_VFS
280+
#endif // MICROPY_VFS && MICROPY_VFS_FAT

extmod/vfs_fat_file.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*/
2626

2727
#include "py/mpconfig.h"
28-
#if MICROPY_VFS
28+
#if MICROPY_VFS && MICROPY_VFS_FAT
2929

3030
#include <stdio.h>
3131
#include <errno.h>
@@ -37,10 +37,8 @@
3737
#include "lib/oofatfs/ff.h"
3838
#include "extmod/vfs_fat.h"
3939

40-
#if MICROPY_VFS_FAT
4140
#define mp_type_fileio fatfs_type_fileio
4241
#define mp_type_textio fatfs_type_textio
43-
#endif
4442

4543
extern const mp_obj_type_t mp_type_fileio;
4644
extern const mp_obj_type_t mp_type_textio;
@@ -300,4 +298,4 @@ mp_obj_t fatfs_builtin_open_self(mp_obj_t self_in, mp_obj_t path, mp_obj_t mode)
300298
return file_open(self, &mp_type_textio, arg_vals);
301299
}
302300

303-
#endif // MICROPY_VFS
301+
#endif // MICROPY_VFS && MICROPY_VFS_FAT

0 commit comments

Comments
 (0)