Skip to content

Commit f826904

Browse files
authored
Merge pull request #7468 from DavePutz/issue_6975
Fixes for microcontroller.on_next_reset() on NRF
2 parents 28afed9 + a30f69a commit f826904

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ports/nrf/common-hal/microcontroller/__init__.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ void common_hal_mcu_enable_interrupts() {
8282

8383
void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) {
8484
enum { DFU_MAGIC_UF2_RESET = 0x57 };
85-
if (runmode == RUNMODE_BOOTLOADER) {
86-
NRF_POWER->GPREGRET = DFU_MAGIC_UF2_RESET;
85+
if (runmode == RUNMODE_BOOTLOADER || runmode == RUNMODE_UF2) {
86+
sd_power_gpregret_set(0,DFU_MAGIC_UF2_RESET);
8787
} else {
88-
NRF_POWER->GPREGRET = 0;
88+
sd_power_gpregret_set(0,0);
8989
}
9090
if (runmode == RUNMODE_SAFE_MODE) {
9191
safe_mode_on_next_reset(PROGRAMMATIC_SAFE_MODE);

0 commit comments

Comments
 (0)