mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
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:
committed by
Peter Johnson
parent
326aecc9a0
commit
9bcff37b93
@@ -8,7 +8,7 @@
|
||||
#include "frc/Compressor.h"
|
||||
|
||||
#include <hal/Compressor.h>
|
||||
#include <hal/HAL.h>
|
||||
#include <hal/FRCUsageReporting.h>
|
||||
#include <hal/Ports.h>
|
||||
#include <hal/Solenoid.h>
|
||||
|
||||
@@ -22,8 +22,7 @@ Compressor::Compressor(int pcmID) : m_module(pcmID) {
|
||||
int32_t status = 0;
|
||||
m_compressorHandle = HAL_InitializeCompressor(m_module, &status);
|
||||
if (status != 0) {
|
||||
wpi_setErrorWithContextRange(status, 0, HAL_GetNumPCMModules(), pcmID,
|
||||
HAL_GetErrorMessage(status));
|
||||
wpi_setHALErrorWithRange(status, 0, HAL_GetNumPCMModules(), pcmID);
|
||||
return;
|
||||
}
|
||||
SetClosedLoopControl(true);
|
||||
|
||||
Reference in New Issue
Block a user