From cb861a5c6a9fcf240955e6fe4f5d2b658c7bc8ef Mon Sep 17 00:00:00 2001 From: Damien George Date: Sun, 13 Apr 2014 13:19:09 +0100 Subject: [PATCH] stm[hal]: Init mp_sys_path and mp_sys_argv correctly. --- stm/main.c | 9 ++++----- stmhal/main.c | 5 +++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/stm/main.c b/stm/main.c index 636f900212..d7f2624c32 100644 --- a/stm/main.c +++ b/stm/main.c @@ -239,11 +239,10 @@ soft_reset: // Micro Python init qstr_init(); mp_init(); - mp_obj_t def_path[3]; - def_path[0] = MP_OBJ_NEW_QSTR(MP_QSTR_0_colon__slash_); - def_path[1] = MP_OBJ_NEW_QSTR(MP_QSTR_0_colon__slash_src); - def_path[2] = MP_OBJ_NEW_QSTR(MP_QSTR_0_colon__slash_lib); - mp_sys_path = mp_obj_new_list(3, def_path); + mp_obj_list_init(mp_sys_path, 0); + mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR_0_colon__slash_)); + mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR_0_colon__slash_lib)); + mp_obj_list_init(mp_sys_argv, 0); exti_init(); diff --git a/stmhal/main.c b/stmhal/main.c index efaf7caf9d..2f40f140a0 100644 --- a/stmhal/main.c +++ b/stmhal/main.c @@ -264,8 +264,9 @@ soft_reset: qstr_init(); mp_init(); 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)); + mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR_0_colon__slash_)); + mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR_0_colon__slash_lib)); + mp_obj_list_init(mp_sys_argv, 0); readline_init();