mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
Suppress Watchdog's generic timeout message in MotorSafety (#1486)
This commit is contained in:
committed by
Peter Johnson
parent
0c3b488e18
commit
41596608cc
@@ -104,6 +104,16 @@ class Watchdog {
|
||||
*/
|
||||
void Disable();
|
||||
|
||||
/**
|
||||
* Enable or disable suppression of the generic timeout message.
|
||||
*
|
||||
* This may be desirable if the user-provided callback already prints a more
|
||||
* specific message.
|
||||
*
|
||||
* @param suppress Whether to suppress generic timeout message.
|
||||
*/
|
||||
void SuppressTimeoutMessage(bool suppress);
|
||||
|
||||
private:
|
||||
// Used for timeout print rate-limiting
|
||||
static constexpr std::chrono::milliseconds kMinPrintPeriod{1000};
|
||||
@@ -118,6 +128,8 @@ class Watchdog {
|
||||
wpi::StringMap<std::chrono::microseconds> m_epochs;
|
||||
bool m_isExpired = false;
|
||||
|
||||
bool m_suppressTimeoutMessage = false;
|
||||
|
||||
class Thread;
|
||||
wpi::SafeThreadOwner<Thread>* m_owner;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user