Add HAL specific version of wpi_setError (#2055)

Cleans up error writing, and allows fewer headers to be included in many of the wpilibc cpp files.

This removes all usages of the hal/HAL.h header.
This commit is contained in:
Thad House
2019-11-08 22:53:20 -08:00
committed by Peter Johnson
parent 326aecc9a0
commit 9bcff37b93
84 changed files with 421 additions and 377 deletions

View File

@@ -7,7 +7,7 @@
#include "frc/AnalogTriggerOutput.h"
#include <hal/HAL.h>
#include <hal/FRCUsageReporting.h>
#include "frc/AnalogTrigger.h"
#include "frc/WPIErrors.h"
@@ -19,7 +19,7 @@ bool AnalogTriggerOutput::Get() const {
bool result = HAL_GetAnalogTriggerOutput(
m_trigger->m_trigger, static_cast<HAL_AnalogTriggerType>(m_outputType),
&status);
wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
wpi_setHALError(status);
return result;
}