summaryrefslogtreecommitdiff
path: root/src/drivers/Watchdog.h
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2020-02-23 20:09:11 (GMT)
committerJF <jf@codingfield.com>2020-02-23 20:09:11 (GMT)
commit0aa1803ea22b119401bcd2e4d9d5278e8386f151 (patch)
treed7c6f7073430a2e3984b390ab0b4e12dc693be83 /src/drivers/Watchdog.h
parentf07ffab4c1fa876e8da9a1bcc895ecf0dfa75acf (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.h17
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);
+
+ };
+ }
+}