Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for microcontroller.on_next_reset() on NRF #7468

Merged
merged 1 commit into from
Jan 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions ports/nrf/common-hal/microcontroller/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ void common_hal_mcu_enable_interrupts() {

void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) {
enum { DFU_MAGIC_UF2_RESET = 0x57 };
if (runmode == RUNMODE_BOOTLOADER) {
NRF_POWER->GPREGRET = DFU_MAGIC_UF2_RESET;
if (runmode == RUNMODE_BOOTLOADER || runmode == RUNMODE_UF2) {
sd_power_gpregret_set(0,DFU_MAGIC_UF2_RESET);
} else {
NRF_POWER->GPREGRET = 0;
sd_power_gpregret_set(0,0);
}
if (runmode == RUNMODE_SAFE_MODE) {
safe_mode_on_next_reset(PROGRAMMATIC_SAFE_MODE);
Expand Down