feed wdt in bootloader if enabled. Since it is impossible to disable wdt

This commit is contained in:
hathach
2018-11-19 17:01:45 +07:00
parent 37690823ac
commit 94e23a928c
10 changed files with 6385 additions and 6375 deletions

View File

@ -27,6 +27,7 @@
#include "app_scheduler.h"
#include "nrfx.h"
#include "nrf_wdt.h"
#include "app_timer.h"
#include "boards.h"
@ -116,6 +117,13 @@ static void wait_for_events(void)
// uint32_t err_code = sd_app_evt_wait();
// APP_ERROR_CHECK(err_code);
// Feed all Watchdog just in case application enable it
// WDT cannot be disabled once started. It even last through soft reset (NVIC Reset)
if ( nrf_wdt_started() )
{
for (uint8_t i=0; i<8; i++) nrf_wdt_reload_request_set(i);
}
// Event received. Process it from the scheduler.
app_sched_execute();