From 494e8ba7229e343a5b6fbd8992e17e2dad9ca8b3 Mon Sep 17 00:00:00 2001 From: Andrew Leech Date: Tue, 1 Mar 2022 15:17:16 +1100 Subject: [PATCH] nrf/mpconfigport: Fix MICROPY_VFS IO build support. --- ports/nrf/mpconfigport.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index e357f01caf..29bdd3f80c 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -133,9 +133,22 @@ #define MICROPY_FATFS_MAX_SS (4096) #endif -// TODO these should be generic, not bound to fatfs +#if MICROPY_VFS +// TODO these should be generic, not bound to a particular FS implementation +#if MICROPY_VFS_FAT +#define mp_type_fileio mp_type_vfs_fat_fileio +#define mp_type_textio mp_type_vfs_fat_textio +#elif MICROPY_VFS_LFS1 +#define mp_type_fileio mp_type_vfs_lfs1_fileio +#define mp_type_textio mp_type_vfs_lfs1_textio +#elif MICROPY_VFS_LFS2 +#define mp_type_fileio mp_type_vfs_lfs2_fileio +#define mp_type_textio mp_type_vfs_lfs2_textio +#endif +#else // !MICROPY_VFS_FAT #define mp_type_fileio fatfs_type_fileio #define mp_type_textio fatfs_type_textio +#endif // Use port specific uos module rather than extmod variant. #define MICROPY_PY_UOS (0)