diff options
| author | JF <jf@codingfield.com> | 2020-04-05 17:59:22 (GMT) |
|---|---|---|
| committer | Gitea <gitea@fake.local> | 2020-04-05 17:59:22 (GMT) |
| commit | 86d5732b960fbe7f81ed711b2de7e6b79293c96a (patch) | |
| tree | 8447f6b7bbff0f423e9cf5d15ed709c630bed25e /src/drivers/Watchdog.h | |
| parent | a91c68c931cc8308e87acd796afb46ba70ae3dc2 (diff) | |
| parent | 6e1bd118c5ecc53016548072501591b329500870 (diff) | |
Merge branch 'develop' of JF/PineTime into master
Diffstat (limited to 'src/drivers/Watchdog.h')
| -rw-r--r-- | src/drivers/Watchdog.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/drivers/Watchdog.h b/src/drivers/Watchdog.h index da192d9..73f99ea 100644 --- a/src/drivers/Watchdog.h +++ b/src/drivers/Watchdog.h @@ -8,10 +8,20 @@ namespace Pinetime { void Setup(uint8_t timeoutSeconds); void Start(); void Kick(); - - ResetReasons ResetReason(); + ResetReasons ResetReason() const { return resetReason; } static const char* ResetReasonToString(ResetReasons reason); + private: + ResetReasons resetReason; + ResetReasons ActualResetReason() const; + }; + + class WatchdogView { + public: + WatchdogView(const Watchdog& watchdog) : watchdog{watchdog} { } + Watchdog::ResetReasons ResetReason() const { return watchdog.ResetReason();} + private: + const Watchdog& watchdog; }; } } |
