I have made my main.py a frozen module and my frozen module directory is "modules"
I have put up main.py in drivers directory and have created a symbolic link to that file in modules
I have modified main.c like this
Code: Select all
// Run the main script from the current directory.
if ((reset_mode == 1 || reset_mode == 3) && pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL) {
const char *main_py;
if (MP_STATE_PORT(pyb_config_main) == MP_OBJ_NULL) {
main_py = "main.py";
} else {
main_py = mp_obj_str_get_str(MP_STATE_PORT(pyb_config_main));
}
mp_import_stat_t stat = mp_import_stat(main_py);
if (stat == MP_IMPORT_STAT_FILE) {
int ret = pyexec_frozen_module(main_py);
if (ret & PYEXEC_FORCED_EXIT) {
goto soft_reset_exit;
}
if (!ret) {
flash_error(3);
}
}
}
If I force the reset_mode to be 1 like this,
Code: Select all
reset_mode = 1;
If I'm messing up with something w.r.t reset_mode, what could be that
Any help is greatly appreciated!!
Thanks in advance!!