mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
[wpilib] Make joystick unplugged warning better in cases of out of range axis/button (#8614)
Closes #8594 Fixes #7700 Also fixes DS HAL to zero out joysticks not received from DS.
This commit is contained in:
@@ -300,6 +300,13 @@ void JoystickDataCache::Update(const mrc::ControlData& data) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Mark remaining sticks as unavailable
|
||||
for (size_t i = sticks.size(); i < HAL_kMaxJoysticks; i++) {
|
||||
axes[i].available = 0;
|
||||
povs[i].available = 0;
|
||||
buttons[i].available = 0;
|
||||
touchpads[i].count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#define CHECK_JOYSTICK_NUMBER(stickNum) \
|
||||
|
||||
Reference in New Issue
Block a user