[wpilibc] DriverStation: Remove ReportError and ReportWarning

Change use cases to directly call FRC_ReportError.
This commit is contained in:
Peter Johnson
2021-05-24 23:36:26 -07:00
parent 831c10bdfc
commit a04d1b4f97
26 changed files with 169 additions and 146 deletions

View File

@@ -5,15 +5,14 @@
#include "frc/Watchdog.h"
#include <atomic>
#include <thread>
#include <utility>
#include <fmt/format.h>
#include <hal/Notifier.h>
#include <wpi/Format.h>
#include <wpi/SmallString.h>
#include <wpi/mutex.h>
#include <wpi/priority_queue.h>
#include <wpi/raw_ostream.h>
#include "frc/DriverStation.h"
#include "frc/Errors.h"
#include "frc2/Timer.h"
@@ -114,11 +113,8 @@ void Watchdog::Impl::Main() {
if (now - watchdog->m_lastTimeoutPrintTime > kMinPrintPeriod) {
watchdog->m_lastTimeoutPrintTime = now;
if (!watchdog->m_suppressTimeoutMessage) {
wpi::SmallString<128> buf;
wpi::raw_svector_ostream err(buf);
err << "Watchdog not fed within "
<< wpi::format("%.6f", watchdog->m_timeout.to<double>()) << "s\n";
frc::DriverStation::ReportWarning(err.str());
FRC_ReportError(warn::Warning, "Watchdog not fed within {:.6f}s",
watchdog->m_timeout.to<double>());
}
}