mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Suppress Watchdog's generic timeout message in MotorSafety (#1486)
This commit is contained in:
committed by
Peter Johnson
parent
0c3b488e18
commit
41596608cc
@@ -51,10 +51,12 @@ void Watchdog::Thread::Main() {
|
||||
auto now = hal::fpga_clock::now();
|
||||
if (now - watchdog->m_lastTimeoutPrintTime > kMinPrintPeriod) {
|
||||
watchdog->m_lastTimeoutPrintTime = now;
|
||||
wpi::outs() << "Watchdog not fed within "
|
||||
<< wpi::format("%.6f",
|
||||
watchdog->m_timeout.count() / 1.0e6)
|
||||
<< "s\n";
|
||||
if (!watchdog->m_suppressTimeoutMessage) {
|
||||
wpi::outs() << "Watchdog not fed within "
|
||||
<< wpi::format("%.6f",
|
||||
watchdog->m_timeout.count() / 1.0e6)
|
||||
<< "s\n";
|
||||
}
|
||||
}
|
||||
lock.unlock();
|
||||
watchdog->m_callback();
|
||||
@@ -159,6 +161,10 @@ void Watchdog::Disable() {
|
||||
thr->m_cond.notify_all();
|
||||
}
|
||||
|
||||
void Watchdog::SuppressTimeoutMessage(bool suppress) {
|
||||
m_suppressTimeoutMessage = suppress;
|
||||
}
|
||||
|
||||
bool Watchdog::operator>(const Watchdog& rhs) {
|
||||
return m_expirationTime > rhs.m_expirationTime;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user