From dfdb0a6487a7acca907af22eca515d3fd159c218 Mon Sep 17 00:00:00 2001 From: Billy Kozak Date: Mon, 17 Aug 2015 11:09:30 -0600 Subject: [PATCH] cc26xx - fixed WDT reloading According to the TRM, the WDT does not produce a reset until it expires twice. After expiring the WDT will set the INT flag if it is unset, and reset the MCU if INT is already set. Before this patch, watchdog_periodic() only un-sets the INT flag. This means that the behaviour of watchdog_periodic is underministic in that the value of the countdown timer will be different depending on when the function was called. This patch fixes this behaviour by also reloading the timout value. --- cpu/cc26xx-cc13xx/dev/contiki-watchdog.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cpu/cc26xx-cc13xx/dev/contiki-watchdog.c b/cpu/cc26xx-cc13xx/dev/contiki-watchdog.c index 401b5637e..5b67df2e1 100644 --- a/cpu/cc26xx-cc13xx/dev/contiki-watchdog.c +++ b/cpu/cc26xx-cc13xx/dev/contiki-watchdog.c @@ -79,6 +79,7 @@ watchdog_start(void) void watchdog_periodic(void) { + ti_lib_watchdog_reload_set(CONTIKI_WATCHDOG_TIMER_TOP); ti_lib_watchdog_int_clear(); } /*---------------------------------------------------------------------------*/