stmhal: Update for static mod sys.
This commit is contained in:
parent
a3e50eacca
commit
4165cd1c0c
@ -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_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_stdout), (mp_obj_t)&mp_sys_stdout_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 = {
|
||||
|
@ -125,6 +125,10 @@ typedef double mp_float_t;
|
||||
#define MICROPY_ENABLE_MOD_SYS (1)
|
||||
#endif
|
||||
|
||||
#ifndef MICROPY_MOD_SYS_STDFILES
|
||||
#define MICROPY_MOD_SYS_STDFILES (0)
|
||||
#endif
|
||||
|
||||
// Whether to support slice object and correspondingly
|
||||
// slice subscript operators
|
||||
#ifndef MICROPY_ENABLE_SLICE
|
||||
|
@ -263,10 +263,9 @@ soft_reset:
|
||||
// Micro Python init
|
||||
qstr_init();
|
||||
mp_init();
|
||||
mp_obj_t def_path[2];
|
||||
def_path[0] = MP_OBJ_NEW_QSTR(MP_QSTR_0_colon__slash_);
|
||||
def_path[1] = MP_OBJ_NEW_QSTR(MP_QSTR_0_colon__slash_lib);
|
||||
mp_sys_path = mp_obj_new_list(2, def_path);
|
||||
mp_obj_list_init(mp_sys_path, 0);
|
||||
mp_obj_list_append(mp_sys_argv, 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_lib));
|
||||
|
||||
readline_init();
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE)
|
||||
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
|
||||
#define MICROPY_PATH_MAX (PATH_MAX)
|
||||
#define MICROPY_MOD_SYS_STDFILES (1)
|
||||
|
||||
// type definitions for the specific machine
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user