mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilib] Moved Watchdog output to reportWarning() (#2413)
This commit is contained in:
@@ -9,8 +9,11 @@
|
||||
|
||||
#include <wpi/Format.h>
|
||||
#include <wpi/PriorityQueue.h>
|
||||
#include <wpi/SmallString.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
|
||||
#include "frc/DriverStation.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
constexpr std::chrono::milliseconds Watchdog::kMinPrintPeriod;
|
||||
@@ -52,10 +55,12 @@ void Watchdog::Thread::Main() {
|
||||
if (now - watchdog->m_lastTimeoutPrintTime > kMinPrintPeriod) {
|
||||
watchdog->m_lastTimeoutPrintTime = now;
|
||||
if (!watchdog->m_suppressTimeoutMessage) {
|
||||
wpi::outs() << "Watchdog not fed within "
|
||||
<< wpi::format("%.6f",
|
||||
watchdog->m_timeout.count() / 1.0e9)
|
||||
<< "s\n";
|
||||
wpi::SmallString<128> buf;
|
||||
wpi::raw_svector_ostream err(buf);
|
||||
err << "Watchdog not fed within "
|
||||
<< wpi::format("%.6f", watchdog->m_timeout.count() / 1.0e9)
|
||||
<< "s\n";
|
||||
frc::DriverStation::ReportWarning(err.str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user