Skip to content
Open
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: 4 additions & 3 deletions ports/nordic/common-hal/watchdog/WatchDogTimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ void common_hal_watchdog_feed(watchdog_watchdogtimer_obj_t *self) {

void common_hal_watchdog_deinit(watchdog_watchdogtimer_obj_t *self) {
if (self->mode == WATCHDOGMODE_RESET) {
if (gc_alloc_possible()) {
mp_raise_RuntimeError(MP_ERROR_TEXT("WatchDogTimer cannot be deinitialized once mode is set to RESET"));
}
// Don't change anything because RESET cannot be undone.
return;
}
Expand Down Expand Up @@ -164,6 +161,10 @@ void common_hal_watchdog_set_mode(watchdog_watchdogtimer_obj_t *self, watchdog_w
}
nrfx_wdt_enable(&wdt);
nrfx_wdt_feed(&wdt);
} else if (current_mode == WATCHDOGMODE_RESET) {
// raise exception on attempt to set mode back from RESET to None
mp_raise_RuntimeError(MP_ERROR_TEXT("WatchDogTimer cannot be deinitialized once mode is set to RESET"));

}

// If we just switched away from RAISE, disable the timmer.
Expand Down
Loading