[hal,wpilib] Use new DS available API from mrccomm (#8302)

Instead of just having a max count for joystick values, there's an available mask of values. This is because in the future we're expecting there to be holes in the list of available buttons and axes. This updates everything to support that scenario.

Also, Joystick buttons, axes, and POVs all now start at 0 instead of 1.
This commit is contained in:
Thad House
2025-10-25 23:03:50 -07:00
committed by GitHub
parent 429698f508
commit 2e10f91e07
62 changed files with 6101 additions and 1066 deletions

View File

@@ -84,19 +84,20 @@ void HALSIM_SetJoystickAxis(int32_t stick, int32_t axis, double value) {}
void HALSIM_SetJoystickPOV(int32_t stick, int32_t pov, HAL_JoystickPOV value) {}
void HALSIM_SetJoystickButtonsValue(int32_t stick, uint32_t buttons) {}
void HALSIM_SetJoystickButtonsValue(int32_t stick, uint64_t buttons) {}
void HALSIM_SetJoystickAxisCount(int32_t stick, int32_t count) {}
void HALSIM_SetJoystickAxesAvailable(int32_t stick, uint16_t available) {}
void HALSIM_SetJoystickPOVCount(int32_t stick, int32_t count) {}
void HALSIM_SetJoystickPOVsAvailable(int32_t stick, uint8_t available) {}
void HALSIM_SetJoystickButtonCount(int32_t stick, int32_t count) {}
void HALSIM_SetJoystickButtonsAvailable(int32_t stick, uint64_t available) {}
void HALSIM_GetJoystickCounts(int32_t stick, int32_t* axisCount,
int32_t* buttonCount, int32_t* povCount) {
*axisCount = 0;
*buttonCount = 0;
*povCount = 0;
void HALSIM_GetJoystickAvailables(int32_t stick, uint16_t* axesAvailable,
uint64_t* buttonsAvailable,
uint8_t* povsAvailable) {
*axesAvailable = 0;
*buttonsAvailable = 0;
*povsAvailable = 0;
}
void HALSIM_SetJoystickIsGamepad(int32_t stick, HAL_Bool isGamepad) {}
@@ -105,8 +106,6 @@ void HALSIM_SetJoystickType(int32_t stick, int32_t type) {}
void HALSIM_SetJoystickName(int32_t stick, const struct WPI_String* name) {}
void HALSIM_SetJoystickAxisType(int32_t stick, int32_t axis, int32_t type) {}
void HALSIM_SetGameSpecificMessage(const struct WPI_String* message) {}
void HALSIM_SetEventName(const struct WPI_String* name) {}