summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-11-16 16:25:06 +1100
committerDamien George <damien.p.george@gmail.com>2016-11-16 18:13:51 +1100
commite5ef15a9d7bead2a60009caedbc128a8906c7ecd (patch)
tree6228f2f42be931bbb7d88f353d9c673be251afd8 /esp8266
parent511c083811ca538753dfccc7c908048b2c23bea4 (diff)
downloadmicropython-e5ef15a9d7bead2a60009caedbc128a8906c7ecd.tar.gz
micropython-e5ef15a9d7bead2a60009caedbc128a8906c7ecd.zip
py/lexer: Provide generic mp_lexer_new_from_file based on mp_reader.
If a port defines MICROPY_READER_POSIX or MICROPY_READER_FATFS then lexer.c now provides an implementation of mp_lexer_new_from_file using the mp_reader_new_file function.
Diffstat (limited to 'esp8266')
-rw-r--r--esp8266/main.c8
-rw-r--r--esp8266/mpconfigport.h2
2 files changed, 3 insertions, 7 deletions
diff --git a/esp8266/main.c b/esp8266/main.c
index a2e747d211..5087c7d6a3 100644
--- a/esp8266/main.c
+++ b/esp8266/main.c
@@ -109,17 +109,13 @@ void user_init(void) {
system_init_done_cb(init_done);
}
-mp_lexer_t *fat_vfs_lexer_new_from_file(const char *filename);
mp_import_stat_t fat_vfs_import_stat(const char *path);
+#if !MICROPY_VFS_FAT
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
}
+#endif
mp_import_stat_t mp_import_stat(const char *path) {
#if MICROPY_VFS_FAT
diff --git a/esp8266/mpconfigport.h b/esp8266/mpconfigport.h
index adbec5d0d8..cc0b229864 100644
--- a/esp8266/mpconfigport.h
+++ b/esp8266/mpconfigport.h
@@ -16,7 +16,7 @@
#define MICROPY_MEM_STATS (0)
#define MICROPY_DEBUG_PRINTERS (1)
#define MICROPY_DEBUG_PRINTER_DEST mp_debug_print
-#define MICROPY_READER_FATFS (1)
+#define MICROPY_READER_FATFS (MICROPY_VFS_FAT)
#define MICROPY_ENABLE_GC (1)
#define MICROPY_STACK_CHECK (1)
#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1)