diff options
| author | JF <JF002@users.noreply.github.com> | 2023-04-30 15:56:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-30 15:56:13 +0200 |
| commit | 5f19f689f9ebe1b00f3f7da22b20fb2700811375 (patch) | |
| tree | 3be88e7476b80b65bf1d01e43fd6b8d5b8b21875 /src/systemtask | |
| parent | c22e30a4a6ef014c7a5086ad47eaab7740a75ff2 (diff) | |
Refactor, document and fix the Watchdog driver (#1710)
* Refactor and document the Watchdog driver to make it more readable.
Fix the configuration of the behaviours configuration that was not properly implemented (but it didn't cause any side effect since the correct value was eventually set in NRF_WDT->CONFIG).
Fix the wrong interpretation of the reset reasons caused by implicit conversions of int to bool.
Diffstat (limited to 'src/systemtask')
| -rw-r--r-- | src/systemtask/SystemTask.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 0621c6ef..b199d53f 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -99,9 +99,9 @@ void SystemTask::Process(void* instance) { void SystemTask::Work() { BootErrors bootError = BootErrors::None; - watchdog.Setup(7); + watchdog.Setup(7, Drivers::Watchdog::SleepBehaviour::Run, Drivers::Watchdog::HaltBehaviour::Pause); watchdog.Start(); - NRF_LOG_INFO("Last reset reason : %s", Pinetime::Drivers::Watchdog::ResetReasonToString(watchdog.ResetReason())); + NRF_LOG_INFO("Last reset reason : %s", Pinetime::Drivers::ResetReasonToString(watchdog.GetResetReason())); APP_GPIOTE_INIT(2); spi.Init(); @@ -403,7 +403,7 @@ void SystemTask::Work() { dateTimeController.UpdateTime(systick_counter); NoInit_BackUpTime = dateTimeController.CurrentDateTime(); if (nrf_gpio_pin_read(PinMap::Button) == 0) { - watchdog.Kick(); + watchdog.Reload(); } } #pragma clang diagnostic pop |
