esp8266/moduos: Add optional support for VfsLfs1 and VfsLfs2.

With this commit an esp8266-based board can now be built with littlefs
support via, eg "make MICROPY_VFS_LFS2=1".
This commit is contained in:
Damien George
2019-11-07 18:44:16 +11:00
parent 6eee5413ff
commit cea9209e0f
3 changed files with 20 additions and 2 deletions

View File

@@ -137,8 +137,16 @@ void *esp_native_code_commit(void*, size_t);
// printer for debugging output, goes to UART only
extern const struct _mp_print_t mp_debug_print;
#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
// use vfs's functions for import stat and builtin open
#define mp_import_stat mp_vfs_import_stat