Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BLE_API mbed-dev nRF51822
WatchDog.h
00001 00002 class WatchDog { 00003 static const uint8_t WDT_TIMEOUT = 10; // sec 00004 00005 public: 00006 static void init() { 00007 // timeout [s] = (CRV + 1) / 32768; 00008 // crv = 32768 * timeout - 1 00009 NRF_WDT->CRV = 32768 * WDT_TIMEOUT - 1; 00010 NRF_WDT->CONFIG = WDT_CONFIG_SLEEP_Pause << WDT_CONFIG_SLEEP_Pos; 00011 NRF_WDT->TASKS_START = 1; 00012 NRF_WDT->RREN = WDT_RREN_RR0_Enabled << WDT_RREN_RR0_Pos; 00013 } 00014 00015 static void reload() { 00016 NRF_WDT->RR[0] = WDT_RR_RR_Reload; 00017 } 00018 00019 };
Generated on Tue Jul 12 2022 14:16:48 by
1.7.2