[hal] Update DS API to new format (#7977)

This commit is contained in:
Thad House
2025-05-16 22:15:14 -07:00
committed by GitHub
parent 1596e2fd7a
commit 231ec348fe
35 changed files with 878 additions and 766 deletions

View File

@@ -387,7 +387,7 @@ int DriverStation::GetStickButtonCount(int stick) {
return buttons.count;
}
bool DriverStation::GetJoystickIsXbox(int stick) {
bool DriverStation::GetJoystickIsGamepad(int stick) {
if (stick < 0 || stick >= kJoystickPorts) {
FRC_ReportError(warn::BadJoystickIndex, "stick {} out of range", stick);
return false;
@@ -396,7 +396,7 @@ bool DriverStation::GetJoystickIsXbox(int stick) {
HAL_JoystickDescriptor descriptor;
HAL_GetJoystickDescriptor(stick, &descriptor);
return static_cast<bool>(descriptor.isXbox);
return static_cast<bool>(descriptor.isGamepad);
}
int DriverStation::GetJoystickType(int stick) {

View File

@@ -225,8 +225,8 @@ void DriverStationSim::SetJoystickButtonCount(int stick, int count) {
HALSIM_SetJoystickButtonCount(stick, count);
}
void DriverStationSim::SetJoystickIsXbox(int stick, bool isXbox) {
HALSIM_SetJoystickIsXbox(stick, isXbox);
void DriverStationSim::SetJoystickIsGamepad(int stick, bool isGamepad) {
HALSIM_SetJoystickIsGamepad(stick, isGamepad);
}
void DriverStationSim::SetJoystickType(int stick, int type) {