diff options
author | Damien George <damien.p.george@gmail.com> | 2014-08-04 10:05:16 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-08-04 10:05:16 +0100 |
commit | 8dbbbbc793554f920cf352b0e67da46abe3974cf (patch) | |
tree | 93dccc679ac010c4087c5d9067fb8da3a98d6b8b /stmhal/main.c | |
parent | 8362bffb2eed310d319b0b96c1b3305eff9c4417 (diff) |
Put call to qstr_init and mp_init_emergency_exc_buf in mp_init.
qstr_init is always called exactly before mp_init, so makes sense to
just have mp_init call it. Similarly with
mp_init_emergency_exception_buf. Doing this makes the ports simpler and
less error prone (ie they can no longer forget to call these).
Diffstat (limited to 'stmhal/main.c')
-rw-r--r-- | stmhal/main.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/stmhal/main.c b/stmhal/main.c index 183f11b7a..442ff9934 100644 --- a/stmhal/main.c +++ b/stmhal/main.c @@ -310,9 +310,14 @@ soft_reset: // GC init gc_init(&_heap_start, &_heap_end); -#if MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF - mp_init_emergency_exception_buf(); -#endif + + // Micro Python init + mp_init(); + mp_obj_list_init(mp_sys_path, 0); + mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR_)); // current dir (or base dir of the script) + mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR__slash_flash)); + mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR__slash_flash_slash_lib)); + mp_obj_list_init(mp_sys_argv, 0); // Change #if 0 to #if 1 if you want REPL on UART_6 (or another uart) // as well as on USB VCP @@ -328,17 +333,7 @@ soft_reset: pyb_stdio_uart = NULL; #endif - // Micro Python init - qstr_init(); - mp_init(); - mp_obj_list_init(mp_sys_path, 0); - mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR_)); // current dir (or base dir of the script) - mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR__slash_flash)); - mp_obj_list_append(mp_sys_path, MP_OBJ_NEW_QSTR(MP_QSTR__slash_flash_slash_lib)); - mp_obj_list_init(mp_sys_argv, 0); - readline_init(); - pin_init(); extint_init(); |