stm32/main: Run optional frozen module at boot.

If a board specifies a filename via MICROPY_BOARD_FROZEN_BOOT_FILE then
that will be run on start up, before the usual boot.py.
pull/7991/head
Peter Boin 2021-09-08 15:45:03 +10:00 zatwierdzone przez Damien George
rodzic 123dcdb8e5
commit e83aa252f7
1 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -564,6 +564,11 @@ soft_reset:
// reset config variables; they should be set by boot.py
MP_STATE_PORT(pyb_config_main) = MP_OBJ_NULL;
// Run optional frozen boot code.
#ifdef MICROPY_BOARD_FROZEN_BOOT_FILE
pyexec_frozen_module(MICROPY_BOARD_FROZEN_BOOT_FILE);
#endif
// Run boot.py (or whatever else a board configures at this stage).
if (MICROPY_BOARD_RUN_BOOT_PY(&state) == BOARDCTRL_GOTO_SOFT_RESET_EXIT) {
goto soft_reset_exit;