diff options
| author | JF <jf@codingfield.com> | 2020-02-23 20:09:11 (GMT) |
|---|---|---|
| committer | JF <jf@codingfield.com> | 2020-02-23 20:09:11 (GMT) |
| commit | 0aa1803ea22b119401bcd2e4d9d5278e8386f151 (patch) | |
| tree | d7c6f7073430a2e3984b390ab0b4e12dc693be83 /src/drivers/Watchdog.h | |
| parent | f07ffab4c1fa876e8da9a1bcc895ecf0dfa75acf (diff) | |
Enable watchdog, and issue a WDT reset when the button is pushed for more than 7s.
Diffstat (limited to 'src/drivers/Watchdog.h')
| -rw-r--r-- | src/drivers/Watchdog.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/drivers/Watchdog.h b/src/drivers/Watchdog.h new file mode 100644 index 0000000..da192d9 --- /dev/null +++ b/src/drivers/Watchdog.h @@ -0,0 +1,17 @@ +#pragma once + +namespace Pinetime { + namespace Drivers { + class Watchdog { + public: + enum class ResetReasons { ResetPin, Watchdog, SoftReset, CpuLockup, SystemOff, LpComp, DebugInterface, NFC, HardReset }; + void Setup(uint8_t timeoutSeconds); + void Start(); + void Kick(); + + ResetReasons ResetReason(); + static const char* ResetReasonToString(ResetReasons reason); + + }; + } +} |
