summaryrefslogtreecommitdiff
path: root/ports/samd/modmachine.c
diff options
context:
space:
mode:
authorrobert-hh <robert@hammelrath.com>2022-12-11 15:33:16 +0100
committerDamien George <damien@micropython.org>2022-12-14 12:50:04 +1100
commit17ab2f671b1abe93ccd0024c6750a63e0c20ee6a (patch)
tree291deade2d0f9fd177d0043cacbef23f4fbfc796 /ports/samd/modmachine.c
parente69313f89c607976da2a7e06ad49b8db9fe1caf9 (diff)
samd: Support entering bootloader via USB CDC 1200bps touch.
Diffstat (limited to 'ports/samd/modmachine.c')
-rw-r--r--ports/samd/modmachine.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ports/samd/modmachine.c b/ports/samd/modmachine.c
index 8adc06f52..ec3e99f16 100644
--- a/ports/samd/modmachine.c
+++ b/ports/samd/modmachine.c
@@ -74,15 +74,14 @@ STATIC mp_obj_t machine_reset(void) {
}
MP_DEFINE_CONST_FUN_OBJ_0(machine_reset_obj, machine_reset);
-STATIC mp_obj_t machine_bootloader(void) {
+NORETURN mp_obj_t 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();
- return mp_const_none;
}
-MP_DEFINE_CONST_FUN_OBJ_0(machine_bootloader_obj, machine_bootloader);
+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) {