watchdog: Rewrite timeoutHandler() to make disabling part of the timeout
This makes no functional changes to the user interface but make future code
reworks shorter.
Change-Id: Ibd57a5d1090588c8a7b2a67730660c3cf47c832e
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/watchdog.hpp b/watchdog.hpp
index e829699..ee5e65d 100644
--- a/watchdog.hpp
+++ b/watchdog.hpp
@@ -72,7 +72,7 @@
/** @brief Gets the remaining time before watchdog expires.
*
- * @return 0 if watchdog is disabled or expired.
+ * @return 0 if watchdog is expired.
* Remaining time in milliseconds otherwise.
*/
uint64_t timeRemaining() const override;
@@ -111,6 +111,9 @@
/** @brief Optional Callback handler on timer expirartion */
void timeOutHandler();
+
+ /** @brief Attempt to disable the watchdog if needed */
+ void tryDisable();
};
} // namespace watchdog