mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
[hal,ntcore,cscore] Update Handle constants to all caps
This commit is contained in:
@@ -36,7 +36,7 @@ HAL_AddressableLEDHandle HAL_InitializeAddressableLED(
|
||||
HAL_DigitalHandle handle;
|
||||
|
||||
auto port = digitalChannelHandles->Allocate(
|
||||
channel, HAL_HandleEnum::AddressableLED, &handle, status);
|
||||
channel, HAL_HandleEnum::ADDRESSABLE_LED, &handle, status);
|
||||
|
||||
if (*status != 0) {
|
||||
if (port) {
|
||||
@@ -62,9 +62,9 @@ HAL_AddressableLEDHandle HAL_InitializeAddressableLED(
|
||||
|
||||
void HAL_FreeAddressableLED(HAL_AddressableLEDHandle handle) {
|
||||
auto port =
|
||||
digitalChannelHandles->Get(handle, HAL_HandleEnum::AddressableLED);
|
||||
digitalChannelHandles->Get(handle, HAL_HandleEnum::ADDRESSABLE_LED);
|
||||
// no status, so no need to check for a proper free.
|
||||
digitalChannelHandles->Free(handle, HAL_HandleEnum::AddressableLED);
|
||||
digitalChannelHandles->Free(handle, HAL_HandleEnum::ADDRESSABLE_LED);
|
||||
if (port == nullptr) {
|
||||
return;
|
||||
}
|
||||
@@ -74,7 +74,7 @@ void HAL_FreeAddressableLED(HAL_AddressableLEDHandle handle) {
|
||||
void HAL_SetAddressableLEDStart(HAL_AddressableLEDHandle handle, int32_t start,
|
||||
int32_t* status) {
|
||||
auto port =
|
||||
digitalChannelHandles->Get(handle, HAL_HandleEnum::AddressableLED);
|
||||
digitalChannelHandles->Get(handle, HAL_HandleEnum::ADDRESSABLE_LED);
|
||||
if (!port) {
|
||||
*status = HAL_HANDLE_ERROR;
|
||||
return;
|
||||
@@ -94,7 +94,7 @@ void HAL_SetAddressableLEDStart(HAL_AddressableLEDHandle handle, int32_t start,
|
||||
void HAL_SetAddressableLEDLength(HAL_AddressableLEDHandle handle,
|
||||
int32_t length, int32_t* status) {
|
||||
auto port =
|
||||
digitalChannelHandles->Get(handle, HAL_HandleEnum::AddressableLED);
|
||||
digitalChannelHandles->Get(handle, HAL_HandleEnum::ADDRESSABLE_LED);
|
||||
if (!port) {
|
||||
*status = HAL_HANDLE_ERROR;
|
||||
return;
|
||||
|
||||
@@ -33,12 +33,12 @@ struct Alert {
|
||||
|
||||
using namespace wpi::hal;
|
||||
|
||||
static UnlimitedHandleResource<HAL_AlertHandle, Alert, HAL_HandleEnum::Alert>*
|
||||
static UnlimitedHandleResource<HAL_AlertHandle, Alert, HAL_HandleEnum::ALERT>*
|
||||
alertHandles;
|
||||
|
||||
namespace wpi::hal::init {
|
||||
void InitializeAlert() {
|
||||
static UnlimitedHandleResource<HAL_AlertHandle, Alert, HAL_HandleEnum::Alert>
|
||||
static UnlimitedHandleResource<HAL_AlertHandle, Alert, HAL_HandleEnum::ALERT>
|
||||
aH;
|
||||
alertHandles = &aH;
|
||||
}
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
|
||||
namespace wpi::hal {
|
||||
IndexedHandleResource<HAL_AnalogInputHandle, wpi::hal::AnalogPort,
|
||||
kNumAnalogInputs, HAL_HandleEnum::AnalogInput>*
|
||||
kNumAnalogInputs, HAL_HandleEnum::ANALOG_INPUT>*
|
||||
analogInputHandles;
|
||||
} // namespace wpi::hal
|
||||
|
||||
namespace wpi::hal::init {
|
||||
void InitializeAnalogInternal() {
|
||||
static IndexedHandleResource<HAL_AnalogInputHandle, wpi::hal::AnalogPort,
|
||||
kNumAnalogInputs, HAL_HandleEnum::AnalogInput>
|
||||
kNumAnalogInputs, HAL_HandleEnum::ANALOG_INPUT>
|
||||
aiH;
|
||||
analogInputHandles = &aiH;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,6 @@ struct AnalogPort {
|
||||
};
|
||||
|
||||
extern IndexedHandleResource<HAL_AnalogInputHandle, wpi::hal::AnalogPort,
|
||||
kNumAnalogInputs, HAL_HandleEnum::AnalogInput>*
|
||||
kNumAnalogInputs, HAL_HandleEnum::ANALOG_INPUT>*
|
||||
analogInputHandles;
|
||||
} // namespace wpi::hal
|
||||
|
||||
@@ -24,12 +24,12 @@ struct PCM {
|
||||
} // namespace
|
||||
|
||||
static IndexedHandleResource<HAL_CTREPCMHandle, PCM, kNumCTREPCMModules,
|
||||
HAL_HandleEnum::CTREPCM>* pcmHandles;
|
||||
HAL_HandleEnum::CTRE_PCM>* pcmHandles;
|
||||
|
||||
namespace wpi::hal::init {
|
||||
void InitializeCTREPCM() {
|
||||
static IndexedHandleResource<HAL_CTREPCMHandle, PCM, kNumCTREPCMModules,
|
||||
HAL_HandleEnum::CTREPCM>
|
||||
HAL_HandleEnum::CTRE_PCM>
|
||||
pH;
|
||||
pcmHandles = &pH;
|
||||
}
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
namespace wpi::hal {
|
||||
|
||||
LimitedHandleResource<HAL_CounterHandle, Counter, kNumCounters,
|
||||
HAL_HandleEnum::Counter>* counterHandles;
|
||||
HAL_HandleEnum::COUNTER>* counterHandles;
|
||||
} // namespace wpi::hal
|
||||
|
||||
namespace wpi::hal::init {
|
||||
void InitializeCounter() {
|
||||
static LimitedHandleResource<HAL_CounterHandle, Counter, kNumCounters,
|
||||
HAL_HandleEnum::Counter>
|
||||
HAL_HandleEnum::COUNTER>
|
||||
cH;
|
||||
counterHandles = &cH;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,6 @@ struct Counter {
|
||||
};
|
||||
|
||||
extern LimitedHandleResource<HAL_CounterHandle, Counter, kNumCounters,
|
||||
HAL_HandleEnum::Counter>* counterHandles;
|
||||
HAL_HandleEnum::COUNTER>* counterHandles;
|
||||
|
||||
} // namespace wpi::hal
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
using namespace wpi::hal;
|
||||
|
||||
static LimitedHandleResource<HAL_DigitalPWMHandle, uint8_t,
|
||||
kNumDigitalPWMOutputs, HAL_HandleEnum::DigitalPWM>*
|
||||
digitalPWMHandles;
|
||||
kNumDigitalPWMOutputs,
|
||||
HAL_HandleEnum::DIGITAL_PWM>* digitalPWMHandles;
|
||||
|
||||
namespace wpi::hal::init {
|
||||
void InitializeDIO() {
|
||||
static LimitedHandleResource<HAL_DigitalPWMHandle, uint8_t,
|
||||
kNumDigitalPWMOutputs,
|
||||
HAL_HandleEnum::DigitalPWM>
|
||||
HAL_HandleEnum::DIGITAL_PWM>
|
||||
dpH;
|
||||
digitalPWMHandles = &dpH;
|
||||
}
|
||||
|
||||
@@ -25,12 +25,12 @@ struct Empty {};
|
||||
} // namespace
|
||||
|
||||
static IndexedHandleResource<HAL_DutyCycleHandle, DutyCycle, kNumDutyCycles,
|
||||
HAL_HandleEnum::DutyCycle>* dutyCycleHandles;
|
||||
HAL_HandleEnum::DUTY_CYCLE>* dutyCycleHandles;
|
||||
|
||||
namespace wpi::hal::init {
|
||||
void InitializeDutyCycle() {
|
||||
static IndexedHandleResource<HAL_DutyCycleHandle, DutyCycle, kNumDutyCycles,
|
||||
HAL_HandleEnum::DutyCycle>
|
||||
HAL_HandleEnum::DUTY_CYCLE>
|
||||
dcH;
|
||||
dutyCycleHandles = &dcH;
|
||||
}
|
||||
|
||||
@@ -31,20 +31,20 @@ struct Empty {};
|
||||
|
||||
static LimitedHandleResource<HAL_EncoderHandle, Encoder,
|
||||
kNumEncoders + kNumCounters,
|
||||
HAL_HandleEnum::Encoder>* encoderHandles;
|
||||
HAL_HandleEnum::ENCODER>* encoderHandles;
|
||||
|
||||
static LimitedHandleResource<HAL_FPGAEncoderHandle, Empty, kNumEncoders,
|
||||
HAL_HandleEnum::FPGAEncoder>* fpgaEncoderHandles;
|
||||
HAL_HandleEnum::FPGA_ENCODER>* fpgaEncoderHandles;
|
||||
|
||||
namespace wpi::hal::init {
|
||||
void InitializeEncoder() {
|
||||
static LimitedHandleResource<HAL_FPGAEncoderHandle, Empty, kNumEncoders,
|
||||
HAL_HandleEnum::FPGAEncoder>
|
||||
HAL_HandleEnum::FPGA_ENCODER>
|
||||
feH;
|
||||
fpgaEncoderHandles = &feH;
|
||||
static LimitedHandleResource<HAL_EncoderHandle, Encoder,
|
||||
kNumEncoders + kNumCounters,
|
||||
HAL_HandleEnum::Encoder>
|
||||
HAL_HandleEnum::ENCODER>
|
||||
eH;
|
||||
encoderHandles = &eH;
|
||||
}
|
||||
@@ -120,9 +120,9 @@ void HAL_FreeEncoder(HAL_EncoderHandle encoderHandle) {
|
||||
if (encoder == nullptr) {
|
||||
return;
|
||||
}
|
||||
if (isHandleType(encoder->nativeHandle, HAL_HandleEnum::FPGAEncoder)) {
|
||||
if (isHandleType(encoder->nativeHandle, HAL_HandleEnum::FPGA_ENCODER)) {
|
||||
fpgaEncoderHandles->Free(encoder->nativeHandle);
|
||||
} else if (isHandleType(encoder->nativeHandle, HAL_HandleEnum::Counter)) {
|
||||
} else if (isHandleType(encoder->nativeHandle, HAL_HandleEnum::COUNTER)) {
|
||||
counterHandles->Free(encoder->nativeHandle);
|
||||
}
|
||||
SimEncoderData[encoder->index].initialized = false;
|
||||
|
||||
@@ -52,7 +52,7 @@ class NotifierThread : public wpi::util::SafeThread {
|
||||
bool m_paused = false;
|
||||
|
||||
UnlimitedHandleResource<HAL_NotifierHandle, Notifier,
|
||||
HAL_HandleEnum::Notifier>
|
||||
HAL_HandleEnum::NOTIFIER>
|
||||
m_handles;
|
||||
|
||||
struct Alarm {
|
||||
|
||||
@@ -24,12 +24,12 @@ struct PCM {
|
||||
} // namespace
|
||||
|
||||
static IndexedHandleResource<HAL_REVPHHandle, PCM, kNumREVPHModules,
|
||||
HAL_HandleEnum::REVPH>* pcmHandles;
|
||||
HAL_HandleEnum::REV_PH>* pcmHandles;
|
||||
|
||||
namespace wpi::hal::init {
|
||||
void InitializeREVPH() {
|
||||
static IndexedHandleResource<HAL_REVPHHandle, PCM, kNumREVPHModules,
|
||||
HAL_HandleEnum::REVPH>
|
||||
HAL_HandleEnum::REV_PH>
|
||||
pH;
|
||||
pcmHandles = &pH;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user