From 0aa1803ea22b119401bcd2e4d9d5278e8386f151 Mon Sep 17 00:00:00 2001 From: JF Date: Sun, 23 Feb 2020 21:09:11 +0100 Subject: Enable watchdog, and issue a WDT reset when the button is pushed for more than 7s. --- src/drivers/Watchdog.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/drivers/Watchdog.h (limited to 'src/drivers/Watchdog.h') diff --git a/src/drivers/Watchdog.h b/src/drivers/Watchdog.h new file mode 100644 index 00000000..da192d9e --- /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); + + }; + } +} -- cgit v1.2.3