nrf/main: Run boot.py and main.py on startup.

This commit is contained in:
Ayke van Laethem 2017-11-15 00:28:30 +01:00 committed by Damien George
parent 66e39d6a4e
commit d9fb8c2585

View File

@ -184,6 +184,16 @@ pin_init0();
MP_PARSE_FILE_INPUT); MP_PARSE_FILE_INPUT);
#endif #endif
#if MICROPY_VFS || MICROPY_HW_HAS_BUILTIN_FLASH
// run boot.py and main.py if they exist.
if (mp_import_stat("boot.py") == MP_IMPORT_STAT_FILE) {
pyexec_file("boot.py");
}
if (mp_import_stat("main.py") == MP_IMPORT_STAT_FILE) {
pyexec_file("main.py");
}
#endif
// Main script is finished, so now go into REPL mode. // Main script is finished, so now go into REPL mode.
// The REPL mode can change, or it can request a soft reset. // The REPL mode can change, or it can request a soft reset.
int ret_code = 0; int ret_code = 0;