mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[hal] Update DS API to new format (#7977)
This commit is contained in:
@@ -320,12 +320,13 @@ void DriverStationData::GetJoystickCounts(int32_t stick, int32_t* axisCount,
|
||||
*povCount = m_joystickData[stick].povs.count;
|
||||
}
|
||||
|
||||
void DriverStationData::SetJoystickIsXbox(int32_t stick, HAL_Bool isXbox) {
|
||||
void DriverStationData::SetJoystickIsGamepad(int32_t stick,
|
||||
HAL_Bool isGamepad) {
|
||||
if (stick < 0 || stick >= kNumJoysticks) {
|
||||
return;
|
||||
}
|
||||
std::scoped_lock lock(m_joystickDataMutex);
|
||||
m_joystickData[stick].descriptor.isXbox = isXbox;
|
||||
m_joystickData[stick].descriptor.isGamepad = isGamepad;
|
||||
m_joystickDescriptorCallbacks(stick, &m_joystickData[stick].descriptor);
|
||||
}
|
||||
|
||||
@@ -532,8 +533,8 @@ void HALSIM_GetJoystickCounts(int32_t stick, int32_t* axisCount,
|
||||
povCount);
|
||||
}
|
||||
|
||||
void HALSIM_SetJoystickIsXbox(int32_t stick, HAL_Bool isXbox) {
|
||||
SimDriverStationData->SetJoystickIsXbox(stick, isXbox);
|
||||
void HALSIM_SetJoystickIsGamepad(int32_t stick, HAL_Bool isGamepad) {
|
||||
SimDriverStationData->SetJoystickIsGamepad(stick, isGamepad);
|
||||
}
|
||||
|
||||
void HALSIM_SetJoystickType(int32_t stick, int32_t type) {
|
||||
|
||||
@@ -105,7 +105,7 @@ class DriverStationData {
|
||||
void GetJoystickCounts(int32_t stick, int32_t* axisCount,
|
||||
int32_t* buttonCount, int32_t* povCount);
|
||||
|
||||
void SetJoystickIsXbox(int32_t stick, HAL_Bool isXbox);
|
||||
void SetJoystickIsGamepad(int32_t stick, HAL_Bool isGamepad);
|
||||
void SetJoystickType(int32_t stick, int32_t type);
|
||||
void SetJoystickName(int32_t stick, std::string_view message);
|
||||
void SetJoystickAxisType(int32_t stick, int32_t axis, int32_t type);
|
||||
|
||||
Reference in New Issue
Block a user