esp8266: Enable FatFs support.

This commit is contained in:
Paul Sokolovsky 2016-03-27 17:13:47 +03:00
parent fe9bc0c573
commit 374654f2b8
4 changed files with 22 additions and 0 deletions

View File

@ -75,6 +75,7 @@ SRC_C = \
utils.c \
ets_alt_task.c \
$(BUILD)/frozen.c \
fatfs_port.o \
STM_SRC_C = $(addprefix stmhal/,\
pybstdio.c \
@ -109,6 +110,8 @@ LIB_SRC_C = $(addprefix lib/,\
timeutils/timeutils.c \
utils/pyexec.c \
utils/printf.c \
fatfs/ff.c \
fatfs/option/ccsbcs.c \
)
SRC_S = \

6
esp8266/fatfs_port.c Normal file
View File

@ -0,0 +1,6 @@
#include "lib/fatfs/ff.h"
#include "lib/fatfs/diskio.h"
DWORD get_fattime(void) {
return 0;
}

View File

@ -34,6 +34,8 @@
#include "genhdr/mpversion.h"
#include "user_interface.h"
extern const mp_obj_type_t mp_fat_vfs_type;
STATIC const qstr os_uname_info_fields[] = {
MP_QSTR_sysname, MP_QSTR_nodename,
MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine
@ -68,6 +70,9 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(os_uname_obj, os_uname);
STATIC const mp_map_elem_t os_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_uos) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_uname), (mp_obj_t)&os_uname_obj },
#if MICROPY_VFS_FAT
{ MP_ROM_QSTR(MP_QSTR_VfsFat), (mp_obj_t)&mp_fat_vfs_type },
#endif
};
STATIC MP_DEFINE_CONST_DICT(os_module_globals, os_module_globals_table);

View File

@ -59,6 +59,14 @@
#define MICROPY_MODULE_FROZEN (1)
#define MICROPY_MODULE_FROZEN_LEXER mp_lexer_new_from_str32
#define MICROPY_FATFS_ENABLE_LFN (1)
#define MICROPY_FATFS_RPATH (2)
#define MICROPY_FATFS_VOLUMES (2)
#define MICROPY_FATFS_MAX_SS (4096)
#define MICROPY_FATFS_LFN_CODE_PAGE (437) /* 1=SFN/ANSI 437=LFN/U.S.(OEM) */
#define MICROPY_FSUSERMOUNT (1)
#define MICROPY_VFS_FAT (1)
#define MICROPY_EVENT_POLL_HOOK {ets_event_poll();}
// type definitions for the specific machine