Commit 4165cd1c authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

stmhal: Update for static mod sys.

parent a3e50eac
...@@ -23,9 +23,11 @@ STATIC const mp_map_elem_t mp_module_sys_globals_table[] = { ...@@ -23,9 +23,11 @@ STATIC const mp_map_elem_t mp_module_sys_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_path), (mp_obj_t)&mp_sys_path_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_path), (mp_obj_t)&mp_sys_path_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_argv), (mp_obj_t)&mp_sys_argv_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_argv), (mp_obj_t)&mp_sys_argv_obj },
#if MICROPY_MOD_SYS_STDFILES
{ MP_OBJ_NEW_QSTR(MP_QSTR_stdin), (mp_obj_t)&mp_sys_stdin_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_stdin), (mp_obj_t)&mp_sys_stdin_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_stdout), (mp_obj_t)&mp_sys_stdout_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_stdout), (mp_obj_t)&mp_sys_stdout_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_stderr), (mp_obj_t)&mp_sys_stderr_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_stderr), (mp_obj_t)&mp_sys_stderr_obj },
#endif
}; };
STATIC const mp_obj_dict_t mp_module_sys_globals = { STATIC const mp_obj_dict_t mp_module_sys_globals = {
......
...@@ -125,6 +125,10 @@ typedef double mp_float_t; ...@@ -125,6 +125,10 @@ typedef double mp_float_t;
#define MICROPY_ENABLE_MOD_SYS (1) #define MICROPY_ENABLE_MOD_SYS (1)
#endif #endif
#ifndef MICROPY_MOD_SYS_STDFILES
#define MICROPY_MOD_SYS_STDFILES (0)
#endif
// Whether to support slice object and correspondingly // Whether to support slice object and correspondingly
// slice subscript operators // slice subscript operators
#ifndef MICROPY_ENABLE_SLICE #ifndef MICROPY_ENABLE_SLICE
......
...@@ -263,10 +263,9 @@ soft_reset: ...@@ -263,10 +263,9 @@ soft_reset:
// Micro Python init // Micro Python init
qstr_init(); qstr_init();
mp_init(); mp_init();
mp_obj_t def_path[2]; mp_obj_list_init(mp_sys_path, 0);
def_path[0] = MP_OBJ_NEW_QSTR(MP_QSTR_0_colon__slash_); mp_obj_list_append(mp_sys_argv, MP_OBJ_NEW_QSTR(MP_QSTR_0_colon__slash_));
def_path[1] = MP_OBJ_NEW_QSTR(MP_QSTR_0_colon__slash_lib); mp_obj_list_append(mp_sys_argv, MP_OBJ_NEW_QSTR(MP_QSTR_0_colon__slash_lib));
mp_sys_path = mp_obj_new_list(2, def_path);
readline_init(); readline_init();
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE) #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE)
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ) #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
#define MICROPY_PATH_MAX (PATH_MAX) #define MICROPY_PATH_MAX (PATH_MAX)
#define MICROPY_MOD_SYS_STDFILES (1)
// type definitions for the specific machine // type definitions for the specific machine
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment