mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Correctly report -1 for POV on disconnected joystick (#1852)
This commit is contained in:
@@ -53,6 +53,9 @@ public class DriverStation {
|
||||
|
||||
HALJoystickPOVs(int count) {
|
||||
m_povs = new short[count];
|
||||
for (int i = 0; i < count; i++) {
|
||||
m_povs[i] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -461,6 +464,7 @@ public class DriverStation {
|
||||
m_cacheDataMutex.unlock();
|
||||
reportJoystickUnpluggedWarning("Joystick POV " + pov + " on port " + stick
|
||||
+ " not available, check if controller is plugged in");
|
||||
return -1;
|
||||
}
|
||||
} finally {
|
||||
if (m_cacheDataMutex.isHeldByCurrentThread()) {
|
||||
|
||||
Reference in New Issue
Block a user