From 22d8a8dd563c4c900005b987fa287b1314cb3667 Mon Sep 17 00:00:00 2001 From: Billy Kozak Date: Mon, 17 Aug 2015 11:11:30 -0600 Subject: [PATCH] cc26xx - implemented watchdog_stop Also modified watchdog_start so that if we stop and start again the watchdog timeout will be reset (by calling watchdog_periodic). --- cpu/cc26xx-cc13xx/dev/contiki-watchdog.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cpu/cc26xx-cc13xx/dev/contiki-watchdog.c b/cpu/cc26xx-cc13xx/dev/contiki-watchdog.c index 5b67df2e1..e12561869 100644 --- a/cpu/cc26xx-cc13xx/dev/contiki-watchdog.c +++ b/cpu/cc26xx-cc13xx/dev/contiki-watchdog.c @@ -70,6 +70,7 @@ watchdog_init(void) void watchdog_start(void) { + watchdog_periodic(); ti_lib_watchdog_reset_enable(); } /*---------------------------------------------------------------------------*/ @@ -83,6 +84,15 @@ watchdog_periodic(void) ti_lib_watchdog_int_clear(); } /*---------------------------------------------------------------------------*/ +/** + * \brief Stops the WDT such that it won't timeout and cause MCU reset + */ +void +watchdog_stop(void) +{ + ti_lib_watchdog_reset_disable(); +} +/*---------------------------------------------------------------------------*/ /** * \brief Manually trigger a WDT reboot */