12 #include <wpi/StringMap.h>
13 #include <wpi/StringRef.h>
15 #include "frc/Notifier.h"
36 explicit Watchdog(
double timeout, std::function<
void()> callback = [] {});
82 std::function<void()> m_callback;
85 double m_startTime = 0.0;
87 bool m_isExpired =
false;
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
Definition: Notifier.h:26
void Enable()
Enables the watchdog timer.
bool IsExpired() const
Returns true if the watchdog timer has expired.
Watchdog(double timeout, std::function< void()> callback=[]{})
Watchdog constructor.
void Reset()
Resets the watchdog timer.
double GetTime() const
Get the time in seconds since the watchdog was last fed.
void PrintEpochs()
Prints list of epochs added so far and their times.
void Disable()
Disable the watchdog.
A class that's a wrapper around a watchdog timer.
Definition: Watchdog.h:28
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
void AddEpoch(wpi::StringRef epochName)
Adds time since last epoch to the list printed by PrintEpochs().