diff options
author | William A. Kennington III <wak@google.com> | 2018-03-01 10:53:25 -0800 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-03-07 11:22:33 +0000 |
commit | 0650a3f09da8899a742988ff55d02eebd6e796aa (patch) | |
tree | b110719075d9f46ef608d8ffedd05d9cf91cc001 /watchdog.cpp | |
parent | 5e3f877179a5b56d098173afb60753b1d1e6c9af (diff) | |
download | phosphor-watchdog-0650a3f09da8899a742988ff55d02eebd6e796aa.tar.gz phosphor-watchdog-0650a3f09da8899a742988ff55d02eebd6e796aa.zip |
watchdog: Add a function to tell us if the timer is running
This helps us refactor some of our existing code and will be useful for
future changes.
Change-Id: Ifa1547f09997d6824f726fc5f46e15eed4c1e8c1
Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'watchdog.cpp')
-rw-r--r-- | watchdog.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/watchdog.cpp b/watchdog.cpp index b5cae66..12631a6 100644 --- a/watchdog.cpp +++ b/watchdog.cpp @@ -50,7 +50,7 @@ uint64_t Watchdog::timeRemaining() const uint64_t timeRemain = 0; // timer may have already expired and disabled - if (timer.getEnabled() != SD_EVENT_OFF) + if (timerEnabled()) { // the one-shot timer does not expire yet auto expiry = duration_cast<milliseconds>( @@ -71,7 +71,7 @@ uint64_t Watchdog::timeRemaining() const // Reset the timer to a new expiration value uint64_t Watchdog::timeRemaining(uint64_t value) { - if (timer.getEnabled() == SD_EVENT_OFF) + if (!timerEnabled()) { // We don't need to update the timer because it is off return 0; |