mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[hal] Update DS API to new format (#7977)
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user