[wpilib] Fix joystick out of range error messages (#3988)

This commit is contained in:
Thad House
2022-02-03 22:10:44 -08:00
committed by GitHub
parent 4b3edb742c
commit 16bf2c70c5
2 changed files with 5 additions and 5 deletions

View File

@@ -10,7 +10,7 @@ S(LoopTimingError, 4, "Digital module loop timing is not the expected value")
S(NonBinaryDigitalValue, 5, "Digital output value is not 0 or 1")
S(IncorrectBatteryChannel, 6,
"Battery measurement channel is not correct value")
S(BadJoystickIndex, 7, "Joystick index is out of range, should be 0-3")
S(BadJoystickIndex, 7, "Joystick index is out of range, should be 0-5")
S(BadJoystickAxis, 8, "Joystick axis or POV is out of range")
S(InvalidMotorIndex, 9, "Motor index is out of range, should be 0-3")
S(DriverStationTaskError, 10, "Driver Station task won't start")

View File

@@ -430,7 +430,7 @@ public class DriverStation {
*/
public static boolean getStickButton(final int stick, final int button) {
if (stick < 0 || stick >= kJoystickPorts) {
throw new IllegalArgumentException("Joystick index is out of range, should be 0-3");
throw new IllegalArgumentException("Joystick index is out of range, should be 0-5");
}
if (button <= 0) {
reportJoystickUnpluggedError("Button indexes begin at 1 in WPILib for C++ and Java\n");
@@ -468,7 +468,7 @@ public class DriverStation {
return false;
}
if (stick < 0 || stick >= kJoystickPorts) {
throw new IllegalArgumentException("Joystick index is out of range, should be 0-3");
throw new IllegalArgumentException("Joystick index is out of range, should be 0-5");
}
m_cacheDataMutex.lock();
@@ -508,7 +508,7 @@ public class DriverStation {
return false;
}
if (stick < 0 || stick >= kJoystickPorts) {
throw new IllegalArgumentException("Joystick index is out of range, should be 0-3");
throw new IllegalArgumentException("Joystick index is out of range, should be 0-5");
}
m_cacheDataMutex.lock();
@@ -610,7 +610,7 @@ public class DriverStation {
*/
public static int getStickButtons(final int stick) {
if (stick < 0 || stick >= kJoystickPorts) {
throw new IllegalArgumentException("Joystick index is out of range, should be 0-3");
throw new IllegalArgumentException("Joystick index is out of range, should be 0-5");
}
m_cacheDataMutex.lock();