diff options
| author | Damien George <damien.p.george@gmail.com> | 2019-10-30 12:08:58 +1100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2019-10-30 12:08:58 +1100 |
| commit | 660a61a38830b67cb4f2b6f921d1db60f51c41a4 (patch) | |
| tree | 44eba7c4436297563fdec8dd2bc46c0888420727 /extmod/vfs_lfs.c | |
| parent | 323d47887f0e407b6560a5957ea934049e70d2aa (diff) | |
extmod/vfs_lfs: Allow compiling in VfsLfs1 and VfsLfs2 separately.
These classes are enabled via the config options MICROPY_VFS_LFS1 and
MICROPY_VFS_LFS2, which are disabled by default.
Diffstat (limited to 'extmod/vfs_lfs.c')
| -rw-r--r-- | extmod/vfs_lfs.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/extmod/vfs_lfs.c b/extmod/vfs_lfs.c index 72f501abb..d77684998 100644 --- a/extmod/vfs_lfs.c +++ b/extmod/vfs_lfs.c @@ -28,7 +28,7 @@ #include "extmod/vfs.h" #include "extmod/vfs_lfs.h" -#if MICROPY_VFS && MICROPY_VFS_LFS +#if MICROPY_VFS && (MICROPY_VFS_LFS1 || MICROPY_VFS_LFS2) enum { LFS_MAKE_ARG_bdev, LFS_MAKE_ARG_readsize, LFS_MAKE_ARG_progsize, LFS_MAKE_ARG_lookahead }; @@ -39,6 +39,8 @@ static const mp_arg_t lfs_make_allowed_args[] = { { MP_QSTR_lookahead, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 32} }, }; +#if MICROPY_VFS_LFS1 + #include "lib/littlefs/lfs1.h" #define LFS_BUILD_VERSION (1) @@ -81,6 +83,10 @@ mp_obj_t mp_vfs_lfs1_file_open(mp_obj_t self_in, mp_obj_t path_in, mp_obj_t mode #undef MP_TYPE_VFS_LFSx #undef MP_TYPE_VFS_LFSx_ +#endif // MICROPY_VFS_LFS1 + +#if MICROPY_VFS_LFS2 + #include "lib/littlefs/lfs2.h" #define LFS_BUILD_VERSION (2) @@ -114,4 +120,6 @@ mp_obj_t mp_vfs_lfs2_file_open(mp_obj_t self_in, mp_obj_t path_in, mp_obj_t mode #include "extmod/vfs_lfsx.c" #include "extmod/vfs_lfsx_file.c" -#endif // MICROPY_VFS && MICROPY_VFS_LFS +#endif // MICROPY_VFS_LFS2 + +#endif // MICROPY_VFS && (MICROPY_VFS_LFS1 || MICROPY_VFS_LFS2) |
