mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-01 02:41:48 +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) {
|
||||
|
||||
@@ -135,7 +135,7 @@ class DriverStation final {
|
||||
* @param stick The joystick port number
|
||||
* @return A boolean that is true if the controller is an xbox controller.
|
||||
*/
|
||||
static bool GetJoystickIsXbox(int stick);
|
||||
static bool GetJoystickIsGamepad(int stick);
|
||||
|
||||
/**
|
||||
* Returns the type of joystick at a given port.
|
||||
|
||||
@@ -323,12 +323,12 @@ class DriverStationSim {
|
||||
static void SetJoystickButtonCount(int stick, int count);
|
||||
|
||||
/**
|
||||
* Sets the value of isXbox for a joystick.
|
||||
* Sets the value of isGamepad for a joystick.
|
||||
*
|
||||
* @param stick The joystick number
|
||||
* @param isXbox The value of isXbox
|
||||
* @param isGamepad The value of isGamepad
|
||||
*/
|
||||
static void SetJoystickIsXbox(int stick, bool isXbox);
|
||||
static void SetJoystickIsGamepad(int stick, bool isGamepad);
|
||||
|
||||
/**
|
||||
* Sets the value of type for a joystick.
|
||||
|
||||
Reference in New Issue
Block a user