ports: Make all ports skip execution of main.py if boot.py fails.

That can be caused e.g. by an exception.  This feature is implemented in
some way already for the stm32, renesas-ra, mimxrt and samd ports.  This
commit adds it for the rp2, esp8266, esp32 and nrf ports.  No change for
the cc3200 and teensy ports.

Signed-off-by: robert-hh <robert@hammelrath.com>
This commit is contained in:
robert-hh
2023-10-11 09:55:14 +02:00
committed by Damien George
parent d2a9d70c09
commit 480659b1ac
4 changed files with 12 additions and 7 deletions

View File

@@ -263,8 +263,10 @@ soft_reset:
#if MICROPY_VFS || MICROPY_MBFS || MICROPY_MODULE_FROZEN
// run boot.py and main.py if they exist.
pyexec_file_if_exists("boot.py");
pyexec_file_if_exists("main.py");
ret = pyexec_file_if_exists("boot.py");
if (pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL && ret != 0) {
pyexec_file_if_exists("main.py");
}
#endif
for (;;) {