extmod/modmachine: Provide common Python bindings for bootloader().

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2023-11-24 18:24:40 +11:00
parent e68aa40d2a
commit 48b5a7b060
22 changed files with 30 additions and 30 deletions

View File

@@ -56,7 +56,6 @@
#define MICROPY_PY_MACHINE_EXTRA_GLOBALS \
{ MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&machine_reset_obj) }, \
{ MP_ROM_QSTR(MP_QSTR_bootloader), MP_ROM_PTR(&machine_bootloader_obj) }, \
{ MP_ROM_QSTR(MP_QSTR_freq), MP_ROM_PTR(&machine_freq_obj) }, \
{ MP_ROM_QSTR(MP_QSTR_unique_id), MP_ROM_PTR(&machine_unique_id_obj) }, \
\
@@ -92,14 +91,13 @@ STATIC mp_obj_t machine_reset(void) {
}
MP_DEFINE_CONST_FUN_OBJ_0(machine_reset_obj, machine_reset);
NORETURN mp_obj_t machine_bootloader(size_t n_args, const mp_obj_t *args) {
NORETURN void mp_machine_bootloader(size_t n_args, const mp_obj_t *args) {
*DBL_TAP_ADDR = DBL_TAP_MAGIC_LOADER;
#ifdef DBL_TAP_ADDR_ALT
*DBL_TAP_ADDR_ALT = DBL_TAP_MAGIC_LOADER;
#endif
NVIC_SystemReset();
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_bootloader_obj, 0, 1, machine_bootloader);
STATIC mp_obj_t machine_freq(size_t n_args, const mp_obj_t *args) {
if (n_args == 0) {

View File

@@ -33,8 +33,6 @@
extern const mp_obj_type_t machine_dac_type;
#endif
NORETURN mp_obj_t machine_bootloader(size_t n_args, const mp_obj_t *args);
void rtc_gettime(timeutils_struct_time_t *tm);
#endif // MICROPY_INCLUDED_SAMD_MODMACHINE_H

View File

@@ -94,6 +94,7 @@
#define MICROPY_PY_TIME_INCLUDEFILE "ports/samd/modtime.c"
#define MICROPY_PY_MACHINE (1)
#define MICROPY_PY_MACHINE_INCLUDEFILE "ports/samd/modmachine.c"
#define MICROPY_PY_MACHINE_BOOTLOADER (1)
#define MICROPY_PY_OS (1)
#define MICROPY_PY_OS_INCLUDEFILE "ports/samd/modos.c"
#define MICROPY_READER_VFS (1)