[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:
Ryan Blue
2026-02-17 23:22:02 -05:00
committed by GitHub
parent 10fa2fced4
commit 0c44e63465
4 changed files with 74 additions and 87 deletions

View File

@@ -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) \