Skip to content

Commit 6e87aeb

Browse files
dpgeorgepfalcon
authored andcommitted
esp8266: Implement multistage bootstrap sequence.
Upon start-up, _boot module is executed from frozen files to do early initialization, e.g. create and mount the flash filesystem. Then "boot.py" is executed if it exists in the filesystem. Finally, "main.py" is executed if exists to allow start-on-boot user applications. This allows a user to make a custom boot file or startup application without recompiling the firmware, while letting to do early initialization in Python code. Based on RFC micropython#1955.
1 parent b69f798 commit 6e87aeb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

esp8266/main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ STATIC void mp_reset(void) {
5454
MP_STATE_PORT(mp_kbd_exception) = mp_obj_new_exception(&mp_type_KeyboardInterrupt);
5555
MP_STATE_PORT(term_obj) = MP_OBJ_NULL;
5656
#if MICROPY_MODULE_FROZEN
57-
pyexec_frozen_module("boot");
57+
pyexec_frozen_module("_boot");
58+
pyexec_file("boot.py");
59+
pyexec_file("main.py");
5860
#endif
5961
}
6062

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy