[hal,wpilib] Rename REVPH compressor constants to all caps

This commit is contained in:
Peter Johnson
2026-03-14 12:11:25 -07:00
parent c18f811ea7
commit 68ca74c129
16 changed files with 72 additions and 72 deletions

View File

@@ -13,16 +13,16 @@
static_assert(
org_wpilib_hardware_hal_REVPHJNI_COMPRESSOR_CONFIG_TYPE_DISABLED ==
HAL_REVPHCompressorConfigType::HAL_REVPHCompressorConfigType_kDisabled);
HAL_REVPHCompressorConfigType::HAL_REVPH_COMPRESSOR_CONFIG_DISABLED);
static_assert(
org_wpilib_hardware_hal_REVPHJNI_COMPRESSOR_CONFIG_TYPE_DIGITAL ==
HAL_REVPHCompressorConfigType::HAL_REVPHCompressorConfigType_kDigital);
HAL_REVPHCompressorConfigType::HAL_REVPH_COMPRESSOR_CONFIG_DIGITAL);
static_assert(
org_wpilib_hardware_hal_REVPHJNI_COMPRESSOR_CONFIG_TYPE_ANALOG ==
HAL_REVPHCompressorConfigType::HAL_REVPHCompressorConfigType_kAnalog);
HAL_REVPHCompressorConfigType::HAL_REVPH_COMPRESSOR_CONFIG_ANALOG);
static_assert(
org_wpilib_hardware_hal_REVPHJNI_COMPRESSOR_CONFIG_TYPE_HYBRID ==
HAL_REVPHCompressorConfigType::HAL_REVPHCompressorConfigType_kHybrid);
HAL_REVPHCompressorConfigType::HAL_REVPH_COMPRESSOR_CONFIG_HYBRID);
using namespace wpi::hal;

View File

@@ -19,13 +19,13 @@
*/
HAL_ENUM(HAL_REVPHCompressorConfigType) {
/** Disabled. */
HAL_REVPHCompressorConfigType_kDisabled = 0,
HAL_REVPH_COMPRESSOR_CONFIG_DISABLED = 0,
/** Digital. */
HAL_REVPHCompressorConfigType_kDigital = 1,
HAL_REVPH_COMPRESSOR_CONFIG_DIGITAL = 1,
/** Analog. */
HAL_REVPHCompressorConfigType_kAnalog = 2,
HAL_REVPH_COMPRESSOR_CONFIG_ANALOG = 2,
/** Hybrid. */
HAL_REVPHCompressorConfigType_kHybrid = 3,
HAL_REVPH_COMPRESSOR_CONFIG_HYBRID = 3,
};
/**

View File

@@ -68,7 +68,7 @@ HAL_REVPHHandle HAL_InitializeREVPH(int32_t busId, int32_t module,
SimREVPHData[module].initialized = true;
// Enable closed loop
SimREVPHData[module].compressorConfigType =
HAL_REVPHCompressorConfigType_kDigital;
HAL_REVPH_COMPRESSOR_CONFIG_DIGITAL;
return handle;
}
@@ -120,7 +120,7 @@ void HAL_SetREVPHClosedLoopControlDisabled(HAL_REVPHHandle handle,
return;
}
SimREVPHData[pcm->module].compressorConfigType =
HAL_REVPHCompressorConfigType_kDisabled;
HAL_REVPH_COMPRESSOR_CONFIG_DISABLED;
}
void HAL_SetREVPHClosedLoopControlDigital(HAL_REVPHHandle handle,
@@ -131,7 +131,7 @@ void HAL_SetREVPHClosedLoopControlDigital(HAL_REVPHHandle handle,
return;
}
SimREVPHData[pcm->module].compressorConfigType =
HAL_REVPHCompressorConfigType_kDigital;
HAL_REVPH_COMPRESSOR_CONFIG_DIGITAL;
}
void HAL_SetREVPHClosedLoopControlAnalog(HAL_REVPHHandle handle,
@@ -144,7 +144,7 @@ void HAL_SetREVPHClosedLoopControlAnalog(HAL_REVPHHandle handle,
return;
}
SimREVPHData[pcm->module].compressorConfigType =
HAL_REVPHCompressorConfigType_kAnalog;
HAL_REVPH_COMPRESSOR_CONFIG_ANALOG;
}
void HAL_SetREVPHClosedLoopControlHybrid(HAL_REVPHHandle handle,
@@ -157,7 +157,7 @@ void HAL_SetREVPHClosedLoopControlHybrid(HAL_REVPHHandle handle,
return;
}
SimREVPHData[pcm->module].compressorConfigType =
HAL_REVPHCompressorConfigType_kHybrid;
HAL_REVPH_COMPRESSOR_CONFIG_HYBRID;
}
HAL_REVPHCompressorConfigType HAL_GetREVPHCompressorConfig(
@@ -165,7 +165,7 @@ HAL_REVPHCompressorConfigType HAL_GetREVPHCompressorConfig(
auto pcm = pcmHandles->Get(handle);
if (pcm == nullptr) {
*status = HAL_HANDLE_ERROR;
return HAL_REVPHCompressorConfigType_kDisabled;
return HAL_REVPH_COMPRESSOR_CONFIG_DISABLED;
}
return SimREVPHData[pcm->module].compressorConfigType;
}

View File

@@ -21,7 +21,7 @@ void REVPHData::ResetData() {
}
initialized.Reset(false);
compressorOn.Reset(false);
compressorConfigType.Reset(HAL_REVPHCompressorConfigType_kDisabled);
compressorConfigType.Reset(HAL_REVPH_COMPRESSOR_CONFIG_DISABLED);
pressureSwitch.Reset(false);
compressorCurrent.Reset(0.0);
}

View File

@@ -37,8 +37,8 @@ class REVPHData {
false};
SimDataValue<HAL_REVPHCompressorConfigType, MakeCompressorConfigTypeValue,
GetCompressorConfigTypeName>
compressorConfigType{HAL_REVPHCompressorConfigType::
HAL_REVPHCompressorConfigType_kDisabled};
compressorConfigType{
HAL_REVPHCompressorConfigType::HAL_REVPH_COMPRESSOR_CONFIG_DISABLED};
SimDataValue<HAL_Bool, HAL_MakeBoolean, GetPressureSwitchName> pressureSwitch{
false};
SimDataValue<double, HAL_MakeDouble, GetCompressorCurrentName>

View File

@@ -344,13 +344,13 @@ HAL_REVPHCompressorConfigType HAL_GetREVPHCompressorConfig(
auto ph = REVPHHandles->Get(handle);
if (ph == nullptr) {
*status = HAL_HANDLE_ERROR;
return HAL_REVPHCompressorConfigType_kDisabled;
return HAL_REVPH_COMPRESSOR_CONFIG_DISABLED;
}
PH_status_0_t status0 = HAL_ReadREVPHStatus0(ph->hcan, status);
if (*status != 0) {
return HAL_REVPHCompressorConfigType_kDisabled;
return HAL_REVPH_COMPRESSOR_CONFIG_DISABLED;
}
return static_cast<HAL_REVPHCompressorConfigType>(status0.compressor_config);

View File

@@ -16,7 +16,7 @@ HAL_SIMDATAVALUE_STUB_CAPI_CHANNEL(HAL_Bool, HALSIM, REVPHSolenoidOutput, false)
DEFINE_CAPI(HAL_Bool, Initialized, false)
DEFINE_CAPI(HAL_Bool, CompressorOn, false)
DEFINE_CAPI(HAL_REVPHCompressorConfigType, CompressorConfigType,
HAL_REVPHCompressorConfigType_kDisabled)
HAL_REVPH_COMPRESSOR_CONFIG_DISABLED)
DEFINE_CAPI(HAL_Bool, PressureSwitch, false)
DEFINE_CAPI(double, CompressorCurrent, 0)