Correctly report -1 for POV on disconnected joystick (#1852)

This commit is contained in:
Peter Johnson
2019-08-25 22:51:54 -07:00
committed by GitHub
parent 076ed7770c
commit decfd858b8

View File

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