From 16bf2c70c50ec16237aed56d5636afa179e85f54 Mon Sep 17 00:00:00 2001 From: Thad House Date: Thu, 3 Feb 2022 22:10:44 -0800 Subject: [PATCH] [wpilib] Fix joystick out of range error messages (#3988) --- wpilibc/src/main/native/include/frc/WPIWarnings.mac | 2 +- .../main/java/edu/wpi/first/wpilibj/DriverStation.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wpilibc/src/main/native/include/frc/WPIWarnings.mac b/wpilibc/src/main/native/include/frc/WPIWarnings.mac index fa63494155..6ac2c11d2c 100644 --- a/wpilibc/src/main/native/include/frc/WPIWarnings.mac +++ b/wpilibc/src/main/native/include/frc/WPIWarnings.mac @@ -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") diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/DriverStation.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/DriverStation.java index 9463389c6f..8eeb28456c 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/DriverStation.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/DriverStation.java @@ -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();