mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilibc] Remove ErrorBase (#3306)
Replace with new exception-based error reporting, consistent with Java. This also builds stacktraces into the reporting/exceptions.
This commit is contained in:
@@ -12,9 +12,9 @@
|
||||
#include <hal/FRCUsageReporting.h>
|
||||
#include <hal/Notifier.h>
|
||||
|
||||
#include "frc/Errors.h"
|
||||
#include "frc/Timer.h"
|
||||
#include "frc/Utility.h"
|
||||
#include "frc/WPIErrors.h"
|
||||
|
||||
using namespace frc;
|
||||
|
||||
@@ -39,7 +39,7 @@ void TimedRobot::StartCompetition() {
|
||||
HAL_UpdateNotifierAlarm(
|
||||
m_notifier, static_cast<uint64_t>(callback.expirationTime * 1e6),
|
||||
&status);
|
||||
wpi_setHALError(status);
|
||||
FRC_CheckErrorStatus(status, "UpdateNotifierAlarm");
|
||||
|
||||
uint64_t curTime = HAL_WaitForNotifierAlarm(m_notifier, &status);
|
||||
if (curTime == 0 || status != 0) {
|
||||
@@ -81,7 +81,7 @@ TimedRobot::TimedRobot(units::second_t period) : IterativeRobotBase(period) {
|
||||
|
||||
int32_t status = 0;
|
||||
m_notifier = HAL_InitializeNotifier(&status);
|
||||
wpi_setHALError(status);
|
||||
FRC_CheckErrorStatus(status, "InitializeNotifier");
|
||||
HAL_SetNotifierName(m_notifier, "TimedRobot", &status);
|
||||
|
||||
HAL_Report(HALUsageReporting::kResourceType_Framework,
|
||||
@@ -92,7 +92,7 @@ TimedRobot::~TimedRobot() {
|
||||
int32_t status = 0;
|
||||
|
||||
HAL_StopNotifier(m_notifier, &status);
|
||||
wpi_setHALError(status);
|
||||
FRC_ReportError(status, "StopNotifier");
|
||||
|
||||
HAL_CleanNotifier(m_notifier, &status);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user