mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
[hal,wpilib] Rename DriverStation constants to all caps
This commit is contained in:
@@ -80,7 +80,7 @@ void JoystickDataCache::Update() {
|
||||
}
|
||||
|
||||
#define CHECK_JOYSTICK_NUMBER(stickNum) \
|
||||
if ((stickNum) < 0 || (stickNum) >= HAL_kMaxJoysticks) \
|
||||
if ((stickNum) < 0 || (stickNum) >= HAL_MAX_JOYSTICKS) \
|
||||
return PARAMETER_OUT_OF_RANGE
|
||||
|
||||
static HAL_ControlWord newestControlWord;
|
||||
@@ -98,7 +98,7 @@ struct TcpCache {
|
||||
void CloneTo(TcpCache* other) { std::memcpy(other, this, sizeof(*this)); }
|
||||
|
||||
HAL_MatchInfo matchInfo;
|
||||
HAL_JoystickDescriptor descriptors[HAL_kMaxJoysticks];
|
||||
HAL_JoystickDescriptor descriptors[HAL_MAX_JOYSTICKS];
|
||||
};
|
||||
static_assert(std::is_standard_layout_v<TcpCache>);
|
||||
} // namespace
|
||||
@@ -109,7 +109,7 @@ static TcpCache tcpCurrent;
|
||||
void TcpCache::Update() {
|
||||
SimDriverStationData->GetMatchInfo(&matchInfo);
|
||||
|
||||
for (int i = 0; i < HAL_kMaxJoysticks; i++) {
|
||||
for (int i = 0; i < HAL_MAX_JOYSTICKS; i++) {
|
||||
SimDriverStationData->GetJoystickDescriptor(i, &descriptors[i]);
|
||||
}
|
||||
}
|
||||
@@ -259,7 +259,7 @@ int32_t HAL_SetOpModeOptions(const struct HAL_OpModeOption* options,
|
||||
|
||||
HAL_AllianceStationID HAL_GetAllianceStation(int32_t* status) {
|
||||
if (gShutdown) {
|
||||
return HAL_AllianceStationID_kUnknown;
|
||||
return HAL_ALLIANCE_STATION_UNKNOWN;
|
||||
}
|
||||
std::scoped_lock lock{driverStation->cacheMutex};
|
||||
return currentRead->allianceStation;
|
||||
|
||||
@@ -46,7 +46,7 @@ DriverStationData::~DriverStationData() {
|
||||
|
||||
void DriverStationData::ResetData() {
|
||||
enabled.Reset(false);
|
||||
robotMode.Reset(HAL_ROBOTMODE_UNKNOWN);
|
||||
robotMode.Reset(HAL_ROBOT_MODE_UNKNOWN);
|
||||
eStop.Reset(false);
|
||||
fmsAttached.Reset(false);
|
||||
dsAttached.Reset(false);
|
||||
@@ -413,7 +413,7 @@ void DriverStationData::SetJoystickAxis(int32_t stick, int32_t axis,
|
||||
if (stick < 0 || stick >= kNumJoysticks) {
|
||||
return;
|
||||
}
|
||||
if (axis < 0 || axis >= HAL_kMaxJoystickAxes) {
|
||||
if (axis < 0 || axis >= HAL_MAX_JOYSTICK_AXES) {
|
||||
return;
|
||||
}
|
||||
std::scoped_lock lock(m_joystickDataMutex);
|
||||
@@ -426,7 +426,7 @@ void DriverStationData::SetJoystickPOV(int32_t stick, int32_t pov,
|
||||
if (stick < 0 || stick >= kNumJoysticks) {
|
||||
return;
|
||||
}
|
||||
if (pov < 0 || pov >= HAL_kMaxJoystickPOVs) {
|
||||
if (pov < 0 || pov >= HAL_MAX_JOYSTICK_POVS) {
|
||||
return;
|
||||
}
|
||||
std::scoped_lock lock(m_joystickDataMutex);
|
||||
@@ -510,10 +510,10 @@ void DriverStationData::SetJoystickTouchpadFinger(int32_t stick,
|
||||
if (stick < 0 || stick >= kNumJoysticks) {
|
||||
return;
|
||||
}
|
||||
if (touchpad < 0 || touchpad >= HAL_kMaxJoystickTouchpads) {
|
||||
if (touchpad < 0 || touchpad >= HAL_MAX_JOYSTICK_TOUCHPADS) {
|
||||
return;
|
||||
}
|
||||
if (finger < 0 || finger >= HAL_kMaxJoystickTouchpadFingers) {
|
||||
if (finger < 0 || finger >= HAL_MAX_JOYSTICK_TOUCHPAD_FINGERS) {
|
||||
return;
|
||||
}
|
||||
std::scoped_lock lock(m_joystickDataMutex);
|
||||
|
||||
@@ -168,7 +168,7 @@ class DriverStationData {
|
||||
|
||||
SimDataValue<HAL_Bool, HAL_MakeBoolean, GetEnabledName> enabled{false};
|
||||
SimDataValue<HAL_RobotMode, MakeRobotModeValue, GetRobotModeName> robotMode{
|
||||
HAL_ROBOTMODE_UNKNOWN};
|
||||
HAL_ROBOT_MODE_UNKNOWN};
|
||||
SimDataValue<HAL_Bool, HAL_MakeBoolean, GetEStopName> eStop{false};
|
||||
SimDataValue<HAL_Bool, HAL_MakeBoolean, GetFmsAttachedName> fmsAttached{
|
||||
false};
|
||||
|
||||
Reference in New Issue
Block a user