diff --git a/ports/zephyr/Makefile b/ports/zephyr/Makefile index 612548dbd0..4357786110 100644 --- a/ports/zephyr/Makefile +++ b/ports/zephyr/Makefile @@ -17,6 +17,8 @@ OUTDIR_PREFIX = $(BOARD) MICROPY_HEAP_SIZE = 16384 FROZEN_DIR = scripts +MICROPY_VFS_FAT ?= 1 + # Default target all: @@ -48,6 +50,7 @@ SRC_C = main.c \ machine_pin.c \ uart_core.c \ zephyr_storage.c \ + lib/timeutils/timeutils.c \ lib/utils/stdout_helpers.c \ lib/utils/printf.c \ lib/utils/pyexec.c \ @@ -61,7 +64,7 @@ SRC_QSTR += $(SRC_C) OBJ = $(PY_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) CFLAGS = $(Z_CFLAGS) \ - -std=gnu99 -fomit-frame-pointer -DNDEBUG -DMICROPY_HEAP_SIZE=$(MICROPY_HEAP_SIZE) $(CFLAGS_EXTRA) $(INC) + -std=gnu99 -fomit-frame-pointer -DNDEBUG -DMICROPY_HEAP_SIZE=$(MICROPY_HEAP_SIZE) $(CFLAGS_MOD) $(CFLAGS_EXTRA) $(INC) include $(TOP)/py/mkrules.mk diff --git a/ports/zephyr/moduos.c b/ports/zephyr/moduos.c index 8bda39b562..d33c317ce6 100644 --- a/ports/zephyr/moduos.c +++ b/ports/zephyr/moduos.c @@ -28,6 +28,10 @@ #include "extmod/vfs.h" +#if MICROPY_VFS_FAT +#include "extmod/vfs_fat.h" +#endif + #if MICROPY_PY_UOS STATIC const mp_rom_map_elem_t uos_module_globals_table[] = { @@ -47,6 +51,9 @@ STATIC const mp_rom_map_elem_t uos_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_mount), MP_ROM_PTR(&mp_vfs_mount_obj) }, { MP_ROM_QSTR(MP_QSTR_umount), MP_ROM_PTR(&mp_vfs_umount_obj) }, #endif + #if MICROPY_VFS_FAT + { MP_ROM_QSTR(MP_QSTR_VfsFat), MP_ROM_PTR(&mp_fat_vfs_type) }, + #endif }; STATIC MP_DEFINE_CONST_DICT(uos_module_globals, uos_module_globals_table); diff --git a/ports/zephyr/mpconfigport.h b/ports/zephyr/mpconfigport.h index 73362f7e9d..7044c175d0 100644 --- a/ports/zephyr/mpconfigport.h +++ b/ports/zephyr/mpconfigport.h @@ -84,6 +84,13 @@ #define MICROPY_VFS (1) #define MICROPY_READER_VFS (MICROPY_VFS) +// fatfs configuration used in ffconf.h +#define MICROPY_FATFS_ENABLE_LFN (1) +#define MICROPY_FATFS_LFN_CODE_PAGE 437 /* 1=SFN/ANSI 437=LFN/U.S.(OEM) */ +#define MICROPY_FATFS_USE_LABEL (1) +#define MICROPY_FATFS_RPATH (2) +#define MICROPY_FATFS_NORTC (1) + // Saving extra crumbs to make sure binary fits in 128K #define MICROPY_COMP_CONST_FOLDING (0) #define MICROPY_COMP_CONST (0)