From 7c4892dc65e8a587ae39278cbeaa62fee3fc6169 Mon Sep 17 00:00:00 2001 From: Carlosgg Date: Sat, 6 Jan 2024 23:20:04 +0000 Subject: [PATCH] ports/esp32: Add `MICROPY_BOARD_FROZEN_BOOT_FILE`. This adds the option to execute custom frozen boot module by defining the macro `MICROPY_BOARD_FROZEN_BOOT_FILE`. This feature is already available in stm32 and mimxrt ports. Signed-off-by: Carlosgg --- ports/esp32/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/esp32/main.c b/ports/esp32/main.c index 6f51b7236b..27012a8fe0 100644 --- a/ports/esp32/main.c +++ b/ports/esp32/main.c @@ -137,6 +137,12 @@ soft_reset: // run boot-up scripts pyexec_frozen_module("_boot.py", false); + + // Run optional frozen boot code. + #ifdef MICROPY_BOARD_FROZEN_BOOT_FILE + pyexec_frozen_module(MICROPY_BOARD_FROZEN_BOOT_FILE, false); + #endif + int ret = pyexec_file_if_exists("boot.py"); if (ret & PYEXEC_FORCED_EXIT) { goto soft_reset_exit;