[hal,wpilib] Rename PowerDistribution constants to all caps

This commit is contained in:
Peter Johnson
2026-03-14 12:01:16 -07:00
parent 261a0ebbd7
commit c18f811ea7
10 changed files with 38 additions and 39 deletions

View File

@@ -30,7 +30,7 @@ extern "C" {
HAL_PowerDistributionHandle HAL_InitializePowerDistribution(
int32_t busId, int32_t module, HAL_PowerDistributionType type,
const char* allocationLocation, int32_t* status) {
if (type == HAL_PowerDistributionType_kAutomatic) {
if (type == HAL_POWER_DISTRIBUTION_AUTOMATIC) {
if (module != HAL_DEFAULT_POWER_DISTRIBUTION_MODULE) {
*status = PARAMETER_OUT_OF_RANGE;
wpi::hal::SetLastError(
@@ -39,13 +39,13 @@ HAL_PowerDistributionHandle HAL_InitializePowerDistribution(
}
// TODO Make this not matter
type = HAL_PowerDistributionType_kCTRE;
type = HAL_POWER_DISTRIBUTION_CTRE;
module = 0;
}
if (!HAL_CheckPowerDistributionModule(module, type)) {
*status = RESOURCE_OUT_OF_RANGE;
if (type == HAL_PowerDistributionType::HAL_PowerDistributionType_kCTRE) {
if (type == HAL_PowerDistributionType::HAL_POWER_DISTRIBUTION_CTRE) {
wpi::hal::SetLastErrorIndexOutOfRange(status,
"Invalid Index for CTRE PDP", 0,
kNumCTREPDPModules - 1, module);
@@ -79,7 +79,7 @@ int32_t HAL_GetPowerDistributionModuleNumber(HAL_PowerDistributionHandle handle,
HAL_Bool HAL_CheckPowerDistributionModule(int32_t module,
HAL_PowerDistributionType type) {
if (type == HAL_PowerDistributionType::HAL_PowerDistributionType_kCTRE) {
if (type == HAL_PowerDistributionType::HAL_POWER_DISTRIBUTION_CTRE) {
return module < kNumCTREPDPModules && module >= 0;
} else {
return module <= kNumREVPDHModules && module >= 1;
@@ -98,7 +98,7 @@ HAL_Bool HAL_CheckPowerDistributionChannel(HAL_PowerDistributionHandle handle,
HAL_PowerDistributionType HAL_GetPowerDistributionType(
HAL_PowerDistributionHandle handle, int32_t* status) {
return HAL_PowerDistributionType::HAL_PowerDistributionType_kCTRE;
return HAL_PowerDistributionType::HAL_POWER_DISTRIBUTION_CTRE;
}
int32_t HAL_GetPowerDistributionNumChannels(HAL_PowerDistributionHandle handle,