diff options
author | Daniel Campora <daniel@wipy.io> | 2015-05-24 18:05:02 +0200 |
---|---|---|
committer | Daniel Campora <daniel@wipy.io> | 2015-05-25 21:14:39 +0200 |
commit | 95f19b4542733e5db2c355a31a37e9562658e26c (patch) | |
tree | a066478bc2a23a13b3d36c1182e85c9c048649f7 | |
parent | 90d7c4ef3d82b49832168426d2e245db0d8a042f (diff) | |
download | micropython-95f19b4542733e5db2c355a31a37e9562658e26c.tar.gz micropython-95f19b4542733e5db2c355a31a37e9562658e26c.zip |
cc3200: Remove duplicated checks for boot.py and main.py existency.
-rw-r--r-- | cc3200/mptask.c | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/cc3200/mptask.c b/cc3200/mptask.c index 7b730c5367..174b0cc5a3 100644 --- a/cc3200/mptask.c +++ b/cc3200/mptask.c @@ -105,7 +105,6 @@ void TASK_Micropython (void *pvParameters) { uint32_t sp = gc_helper_get_sp(); gc_collect_init (sp); bool safeboot = false; - FRESULT res; mptask_pre_init(); @@ -184,18 +183,14 @@ soft_reset: MP_STATE_PORT(pyb_config_main) = MP_OBJ_NULL; if (!safeboot) { - // run boot.py, if it exists - const char *boot_py = "boot.py"; - res = f_stat(boot_py, NULL); - if (res == FR_OK) { - int ret = pyexec_file(boot_py); - if (ret & PYEXEC_FORCED_EXIT) { - goto soft_reset_exit; - } - if (!ret) { - // flash the system led - mperror_signal_error(); - } + // run boot.py + int ret = pyexec_file("boot.py"); + if (ret & PYEXEC_FORCED_EXIT) { + goto soft_reset_exit; + } + if (!ret) { + // flash the system led + mperror_signal_error(); } } @@ -214,16 +209,13 @@ soft_reset: } else { main_py = mp_obj_str_get_str(MP_STATE_PORT(pyb_config_main)); } - res = f_stat(main_py, NULL); - if (res == FR_OK) { - int ret = pyexec_file(main_py); - if (ret & PYEXEC_FORCED_EXIT) { - goto soft_reset_exit; - } - if (!ret) { - // flash the system led - mperror_signal_error(); - } + int ret = pyexec_file(main_py); + if (ret & PYEXEC_FORCED_EXIT) { + goto soft_reset_exit; + } + if (!ret) { + // flash the system led + mperror_signal_error(); } } } |