Merge pull request #741 from jepler/samd-reset-modes

Samd reset modes
This commit is contained in:
Scott Shawcroft 2018-04-05 10:39:51 -07:00 committed by GitHub
commit 8f3bf5faf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

@ -55,7 +55,7 @@ extern uint32_t _ezero;
void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) {
// Set up the defaults.
_bootloader_dbl_tap = DBL_TAP_MAGIC;
_bootloader_dbl_tap = DBL_TAP_MAGIC_QUICK_BOOT;
_ezero = CIRCUITPY_CANARY_WORD;
if (runmode == RUNMODE_BOOTLOADER) {

View File

@ -31,6 +31,7 @@
// Copied from inc/uf2.h in https://github.com/Microsoft/uf2-samd21
#define DBL_TAP_MAGIC 0xf01669ef // Randomly selected, adjusted to have first and last bit set
#define DBL_TAP_MAGIC_QUICK_BOOT 0xf02669ef
extern uint32_t _bootloader_dbl_tap;

View File

@ -76,7 +76,7 @@ STATIC void mcu_runmode_print(const mp_print_t *print, mp_obj_t self_in, mp_prin
runmode = MP_QSTR_SAFE_MODE;
} else if (MP_OBJ_TO_PTR(self_in) ==
MP_ROM_PTR(&mcu_runmode_bootloader_obj)) {
runmode = MP_QSTR_SAFE_MODE;
runmode = MP_QSTR_BOOTLOADER;
}
mp_printf(print, "%q.%q.%q", MP_QSTR_microcontroller, MP_QSTR_RunMode,
runmode);