mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-01 02:41:48 +00:00
Set POV values on error to return -1 rather than 0 AND bump the version number (artf4005)
Change-Id: I6fffb693a8e58427086b9f9a673cd70bebdbca33
This commit is contained in:
@@ -270,7 +270,7 @@ int DriverStation::GetStickPOV(uint32_t stick, uint32_t pov) {
|
||||
if (stick >= kJoystickPorts)
|
||||
{
|
||||
wpi_setWPIError(BadJoystickIndex);
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (pov >= m_joystickPOVs[stick].count)
|
||||
@@ -279,7 +279,7 @@ int DriverStation::GetStickPOV(uint32_t stick, uint32_t pov) {
|
||||
wpi_setWPIError(BadJoystickAxis);
|
||||
else
|
||||
ReportJoystickUnpluggedError("WARNING: Joystick POV missing, check if all controllers are plugged in\n");
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return m_joystickPOVs[stick].povs[pov];
|
||||
|
||||
@@ -65,7 +65,7 @@ RobotBase::RobotBase()
|
||||
FILE *file = NULL;
|
||||
file = fopen("/tmp/frc_versions/FRC_Lib_Version.ini", "w");
|
||||
|
||||
fputs("2015 C++ 1.1.0", file);
|
||||
fputs("2015 C++ 1.2.0", file);
|
||||
if (file != NULL)
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ public class DriverStation implements RobotState.Interface {
|
||||
|
||||
if (pov >= m_joystickPOVs[stick].length) {
|
||||
reportJoystickUnpluggedError("WARNING: Joystick POV " + pov + " on port " + stick + " not available, check if controller is plugged in\n");
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return m_joystickPOVs[stick][pov];
|
||||
|
||||
@@ -216,7 +216,7 @@ public abstract class RobotBase {
|
||||
|
||||
output = new FileOutputStream(file);
|
||||
|
||||
output.write("2015 Java 1.1.0".getBytes());
|
||||
output.write("2015 Java 1.2.0".getBytes());
|
||||
|
||||
} catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user