File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,7 +156,6 @@ SRC_C = \
156156 lib/fatfs/option/ccsbcs.c \
157157 lib/timeutils/timeutils.c \
158158 lib/utils/stdout_helpers.c \
159- lib/utils/printf.c \
160159 lib/utils/pyexec.c \
161160 lib/libc/string0.c \
162161 lib/mp-readline/readline.c
Original file line number Diff line number Diff line change @@ -157,13 +157,18 @@ void init_flash_fs() {
157157}
158158
159159static char * stack_top ;
160- static char heap [8192 ];
160+ static char heap [16384 ];
161161
162162void reset_mp () {
163163 #if MICROPY_ENABLE_GC
164164 gc_init (heap , heap + sizeof (heap ));
165165 #endif
166166 mp_init ();
167+ mp_obj_list_init (mp_sys_path , 0 );
168+ mp_obj_list_append (mp_sys_path , MP_OBJ_NEW_QSTR (MP_QSTR_ )); // current dir (or base dir of the script)
169+ mp_obj_list_append (mp_sys_path , MP_OBJ_NEW_QSTR (MP_QSTR__slash_flash ));
170+ mp_obj_list_append (mp_sys_path , MP_OBJ_NEW_QSTR (MP_QSTR__slash_flash_slash_lib ));
171+ mp_obj_list_init (mp_sys_argv , 0 );
167172
168173 MP_STATE_PORT (mp_kbd_exception ) = mp_obj_new_exception (& mp_type_KeyboardInterrupt );
169174
@@ -225,12 +230,24 @@ void gc_collect(void) {
225230 gc_dump_info ();
226231}
227232
233+ mp_lexer_t * fat_vfs_lexer_new_from_file (const char * filename );
228234mp_lexer_t * mp_lexer_new_from_file (const char * filename ) {
235+ #if MICROPY_VFS_FAT
236+ return fat_vfs_lexer_new_from_file (filename );
237+ #else
238+ (void )filename ;
229239 return NULL ;
240+ #endif
230241}
231242
243+ mp_import_stat_t fat_vfs_import_stat (const char * path );
232244mp_import_stat_t mp_import_stat (const char * path ) {
245+ #if MICROPY_VFS_FAT
246+ return fat_vfs_import_stat (path );
247+ #else
248+ (void )path ;
233249 return MP_IMPORT_STAT_NO_EXIST ;
250+ #endif
234251}
235252
236253void mp_keyboard_interrupt (void ) {
Original file line number Diff line number Diff line change 2727#define MICROPY_HELPER_LEXER_UNIX (0)
2828#define MICROPY_ENABLE_SOURCE_LINE (0)
2929#define MICROPY_ENABLE_DOC_STRING (0)
30- #define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_TERSE )
30+ #define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_NORMAL )
3131#define MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG (0)
3232#define MICROPY_PY_ASYNC_AWAIT (0)
3333#define MICROPY_PY_BUILTINS_BYTEARRAY (1)
4949#define MICROPY_PY_CMATH (1)
5050#define MICROPY_PY_IO (0)
5151#define MICROPY_PY_STRUCT (1)
52- #define MICROPY_PY_SYS (0 )
52+ #define MICROPY_PY_SYS (1 )
5353#define MICROPY_MODULE_FROZEN_MPY (1)
5454#define MICROPY_CPYTHON_COMPAT (0)
5555#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_NONE)
7070#define MICROPY_REPL_AUTO_INDENT (1)
7171#define MICROPY_HW_ENABLE_DAC (1)
7272#define MICROPY_ENABLE_FINALISER (1)
73+ #define MICROPY_USE_INTERNAL_PRINTF (1)
7374
7475// type definitions for the specific machine
7576
You can’t perform that action at this time.
0 commit comments