Skip to content

Commit 772ce22

Browse files
committed
nrf/vfs: Fix MICROPY_VFS IO build support.
1 parent 6286d93 commit 772ce22

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

ports/nrf/mpconfigport.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,23 @@
133133
#define MICROPY_FATFS_MAX_SS (4096)
134134
#endif
135135

136-
// TODO these should be generic, not bound to fatfs
136+
// use vfs's functions for import stat and builtin open
137+
#if MICROPY_VFS
138+
#if MICROPY_VFS_FAT
139+
#define mp_type_fileio mp_type_vfs_fat_fileio
140+
#define mp_type_textio mp_type_vfs_fat_textio
141+
#elif MICROPY_VFS_LFS1
142+
#define mp_type_fileio mp_type_vfs_lfs1_fileio
143+
#define mp_type_textio mp_type_vfs_lfs1_textio
144+
#elif MICROPY_VFS_LFS2
145+
#define mp_type_fileio mp_type_vfs_lfs2_fileio
146+
#define mp_type_textio mp_type_vfs_lfs2_textio
147+
#endif
148+
149+
#else // !MICROPY_VFS_FAT
137150
#define mp_type_fileio fatfs_type_fileio
138151
#define mp_type_textio fatfs_type_textio
152+
#endif
139153

140154
#define MICROPY_STREAMS_NON_BLOCK (1)
141155
#define MICROPY_MODULE_WEAK_LINKS (1)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy