MySensors Library & Examples
2.3.2-62-ge298769
|
This header file declares the interface to some inline macros handling the watchdog timer like present in many AVR devices. In order to prevent the watchdog timer configuration from being accidentally altered by a crashing application, a special timed sequence is required in order to change it. The macros within this header file handle the required sequence automatically before changing any value. Interrupts will be disabled during the manipulation.
Macros | |
#define | wdt_reset() NRF_WDT->RR[0] = WDT_RR_RR_Reload |
#define | wdt_enable(timeout) |
#define | wdt_disable() |
#define | WDTO_15MS 15 |
#define | WDTO_30MS 30 |
#define | WDTO_60MS 60 |
#define | WDTO_120MS 120 |
#define | WDTO_250MS 250 |
#define | WDTO_500MS 500 |
#define | WDTO_1S 1000 |
#define | WDTO_2S 2000 |
#define | WDTO_4S 4000 |
#define | WDTO_8S 8000 |
#define wdt_disable | ( | ) |
Disable the watchdog timer. On nRF5 the timer cannot disabled. The period is set to 36h of CPU run time. The WDT is stopped in sleep mode.
#define wdt_enable | ( | timeout | ) |
Enable the watchdog timer, configuring it for expiry after timeout
(ms).
The WDT is running in sleep mode.
See also the symbolic constants WDTO_15MS
et al.
#define wdt_reset | ( | ) | NRF_WDT->RR[0] = WDT_RR_RR_Reload |
#define WDTO_15MS 15 |
Symbolic constants for the watchdog timeout.
Possible timeout values are: 15 ms, 30 ms, 60 ms, 120 ms, 250 ms, 500 ms, 1 s, 2 s, 4s, 8s. (Not all devices allow 4 s or 8 s.) Symbolic constants are formed by the prefix WDTO_
, followed by the time.
Example that would select a watchdog timer expiry of approximately 500 ms:
#define WDTO_4S 4000 |
See WDTO_15MS
Note: This is only available on the ATtiny2313, ATtiny24, ATtiny44, ATtiny84, ATtiny84A, ATtiny25, ATtiny45, ATtiny85, ATtiny261, ATtiny461, ATtiny861, ATmega48, ATmega88, ATmega168, ATmega48P, ATmega88P, ATmega168P, ATmega328P, ATmega164P, ATmega324P, ATmega644P, ATmega644, ATmega640, ATmega1280, ATmega1281, ATmega2560, ATmega2561, ATmega8HVA, ATmega16HVA, ATmega32HVB, ATmega406, ATmega1284P, AT90PWM1, AT90PWM2, AT90PWM2B, AT90PWM3, AT90PWM3B, AT90PWM216, AT90PWM316, AT90PWM81, AT90PWM161, AT90USB82, AT90USB162, AT90USB646, AT90USB647, AT90USB1286, AT90USB1287, ATtiny48, ATtiny88, nRF51822, nRF52832
#define WDTO_8S 8000 |
See WDTO_15MS
Note: This is only available on the ATtiny2313, ATtiny24, ATtiny44, ATtiny84, ATtiny84A, ATtiny25, ATtiny45, ATtiny85, ATtiny261, ATtiny461, ATtiny861, ATmega48, ATmega48A, ATmega48PA, ATmega88, ATmega168, ATmega48P, ATmega88P, ATmega168P, ATmega328P, ATmega164P, ATmega324P, ATmega644P, ATmega644, ATmega640, ATmega1280, ATmega1281, ATmega2560, ATmega2561, ATmega8HVA, ATmega16HVA, ATmega32HVB, ATmega406, ATmega1284P, ATmega2564RFR2, ATmega256RFR2, ATmega1284RFR2, ATmega128RFR2, ATmega644RFR2, ATmega64RFR2 AT90PWM1, AT90PWM2, AT90PWM2B, AT90PWM3, AT90PWM3B, AT90PWM216, AT90PWM316, AT90PWM81, AT90PWM161, AT90USB82, AT90USB162, AT90USB646, AT90USB647, AT90USB1286, AT90USB1287, ATtiny48, ATtiny88, ATxmega16a4u, ATxmega32a4u, ATxmega16c4, ATxmega32c4, ATxmega128c3, ATxmega192c3, ATxmega256c3, nRF51822, nRF52832