[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

@@ -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();