stm32/modmachine: Factor out mboot enter code to a function.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2022-06-17 13:57:47 +10:00
parent c5d26ee5e7
commit d8e7ecd231
3 changed files with 27 additions and 17 deletions

View File

@@ -38,8 +38,12 @@
#endif
#ifndef MICROPY_BOARD_ENTER_BOOTLOADER
#if MICROPY_HW_USES_BOOTLOADER
#define MICROPY_BOARD_ENTER_BOOTLOADER(nargs, args) boardctrl_maybe_enter_mboot(nargs, args)
#else
#define MICROPY_BOARD_ENTER_BOOTLOADER(nargs, args)
#endif
#endif
#ifndef MICROPY_BOARD_EARLY_INIT
#define MICROPY_BOARD_EARLY_INIT()
@@ -106,6 +110,7 @@ typedef struct _boardctrl_state_t {
bool log_soft_reset;
} boardctrl_state_t;
void boardctrl_maybe_enter_mboot(size_t n_args, const void *args);
void boardctrl_before_soft_reset_loop(boardctrl_state_t *state);
void boardctrl_top_soft_reset_loop(boardctrl_state_t *state);
int boardctrl_run_boot_py(boardctrl_state_t *state);