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

Software reset #193

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/sdk11/components/libraries/bootloader_dfu/bootloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ static void wait_for_events(void)
// uint32_t err_code = sd_app_evt_wait();
// APP_ERROR_CHECK(err_code);

#ifdef SOFTWARE_RESET_BUTTON
if (button_pressed(SOFTWARE_RESET_BUTTON)) {
while(button_pressed(SOFTWARE_RESET_BUTTON)) { NRFX_DELAY_MS(10); }
NVIC_SystemReset();
}
#endif

// Feed all Watchdog just in case application enable it
// WDT cannot be disabled once started. It even last through NVIC soft reset
if ( nrf_wdt_started(NRF_WDT) )
Expand Down
3 changes: 3 additions & 0 deletions src/boards/boards.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ void board_init(void)

button_init(BUTTON_DFU);
button_init(BUTTON_FRESET);
#ifdef SOFTWARE_RESET_BUTTON
button_init(SOFTWARE_RESET_BUTTON);
#endif
NRFX_DELAY_US(100); // wait for the pin state is stable

#if LEDS_NUMBER > 0
Expand Down