mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-01 02:41:48 +00:00
[wpilib] Fix joystick out of range error messages (#3988)
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user