Disable stupid WPILib messages about joysticks
They break the driver's station if you don't have any joysticks plugged
in, and they're dangerous during matches.
Change-Id: I5065b674bd503c5dc02b8c6e8925da5f737ed501
diff --git a/third_party/allwpilib_2016/wpilibc/Athena/include/DriverStation.h b/third_party/allwpilib_2016/wpilibc/Athena/include/DriverStation.h
index 23ee095..bf35ec2 100644
--- a/third_party/allwpilib_2016/wpilibc/Athena/include/DriverStation.h
+++ b/third_party/allwpilib_2016/wpilibc/Athena/include/DriverStation.h
@@ -94,7 +94,6 @@
private:
static DriverStation *m_instance;
- void ReportJoystickUnpluggedError(std::string message);
void Run();
HALJoystickAxes m_joystickAxes[kJoystickPorts];
@@ -112,5 +111,4 @@
bool m_userInAutonomous = false;
bool m_userInTeleop = false;
bool m_userInTest = false;
- double m_nextMessageTime = 0;
};
diff --git a/third_party/allwpilib_2016/wpilibc/Athena/src/DriverStation.cpp b/third_party/allwpilib_2016/wpilibc/Athena/src/DriverStation.cpp
index 455a987..e1d2925 100644
--- a/third_party/allwpilib_2016/wpilibc/Athena/src/DriverStation.cpp
+++ b/third_party/allwpilib_2016/wpilibc/Athena/src/DriverStation.cpp
@@ -122,18 +122,6 @@
}
/**
- * Reports errors related to unplugged joysticks
- * Throttles the errors so that they don't overwhelm the DS
- */
-void DriverStation::ReportJoystickUnpluggedError(std::string message) {
- double currentTime = Timer::GetFPGATimestamp();
- if (currentTime > m_nextMessageTime) {
- ReportError(message);
- m_nextMessageTime = currentTime + JOYSTICK_UNPLUGGED_MESSAGE_INTERVAL;
- }
-}
-
-/**
* Returns the number of axes on a given joystick port
*
* @param stick The joystick port number
@@ -254,10 +242,6 @@
if (axis >= m_joystickAxes[stick].count) {
if (axis >= kMaxJoystickAxes)
wpi_setWPIError(BadJoystickAxis);
- else
- ReportJoystickUnpluggedError(
- "WARNING: Joystick Axis missing, check if all controllers are "
- "plugged in\n");
return 0.0f;
}
@@ -284,10 +268,6 @@
if (pov >= m_joystickPOVs[stick].count) {
if (pov >= kMaxJoystickPOVs)
wpi_setWPIError(BadJoystickAxis);
- else
- ReportJoystickUnpluggedError(
- "WARNING: Joystick POV missing, check if all controllers are plugged "
- "in\n");
return -1;
}
@@ -323,14 +303,9 @@
}
if (button > m_joystickButtons[stick].count) {
- ReportJoystickUnpluggedError(
- "WARNING: Joystick Button missing, check if all controllers are "
- "plugged in\n");
return false;
}
if (button == 0) {
- ReportJoystickUnpluggedError(
- "ERROR: Button indexes begin at 1 in WPILib for C++ and Java");
return false;
}
return ((0x1 << (button - 1)) & m_joystickButtons[stick].buttons) != 0;