aboutsummaryrefslogtreecommitdiff
path: root/esp8266/main.c
diff options
context:
space:
mode:
authorPaul Sokolovsky2016-03-28 21:35:41 +0300
committerPaul Sokolovsky2016-03-28 21:35:41 +0300
commitb4070ee8a431409c7200383fb675ee2013583095 (patch)
tree3051c04a63e56c5eace2f77aa718b9a0954284d7 /esp8266/main.c
parent2f02302e22cb8f6151331969391e65fe3a26a759 (diff)
esp8266: Allow to build without FatFs support again.
Diffstat (limited to 'esp8266/main.c')
-rw-r--r--esp8266/main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/esp8266/main.c b/esp8266/main.c
index fe5fc81b6..908a2c61a 100644
--- a/esp8266/main.c
+++ b/esp8266/main.c
@@ -48,7 +48,9 @@ STATIC void mp_reset(void) {
mp_init();
mp_obj_list_init(mp_sys_path, 0);
mp_obj_list_init(mp_sys_argv, 0);
+ #if MICROPY_VFS_FAT
memset(MP_STATE_PORT(fs_user_mount), 0, sizeof(MP_STATE_PORT(fs_user_mount)));
+ #endif
MP_STATE_PORT(mp_kbd_exception) = mp_obj_new_exception(&mp_type_KeyboardInterrupt);
#if MICROPY_MODULE_FROZEN
pyexec_frozen_module("boot");
@@ -77,11 +79,21 @@ mp_lexer_t *fat_vfs_lexer_new_from_file(const char *filename);
mp_import_stat_t fat_vfs_import_stat(const char *path);
mp_lexer_t *mp_lexer_new_from_file(const char *filename) {
+ #if MICROPY_VFS_FAT
return fat_vfs_lexer_new_from_file(filename);
+ #else
+ (void)filename;
+ return NULL;
+ #endif
}
mp_import_stat_t mp_import_stat(const char *path) {
+ #if MICROPY_VFS_FAT
return fat_vfs_import_stat(path);
+ #else
+ (void)path;
+ return MP_IMPORT_STAT_NO_EXIST;
+ #endif
}
mp_obj_t mp_builtin_open(uint n_args, const mp_obj_t *args, mp_map_t *kwargs) {