Merge "Require Jaguar version v108 or higher."

This commit is contained in:
Brad Miller (WPI)
2014-12-09 14:21:10 -08:00
committed by Gerrit Code Review
2 changed files with 17 additions and 3 deletions

View File

@@ -179,16 +179,16 @@ void CANJaguar::InitCANJaguar()
return;
// 3330 was the first shipping RDK firmware version for the Jaguar
if (m_firmwareVersion >= 3330 || m_firmwareVersion < 101)
if (m_firmwareVersion >= 3330 || m_firmwareVersion < 108)
{
char buf[256];
if (m_firmwareVersion < 3330)
{
snprintf(buf, 256, "Jag #%d firmware (%d) is too old (must be at least version 101 of the FIRST approved firmware)", m_deviceNumber, m_firmwareVersion);
snprintf(buf, 256, "Jag #%d firmware (%d) is too old (must be at least version 108 of the FIRST approved firmware)", m_deviceNumber, m_firmwareVersion);
}
else
{
snprintf(buf, 256, "Jag #%d firmware (%d) is not FIRST approved (must be at least version 101 of the FIRST approved firmware)", m_deviceNumber, m_firmwareVersion);
snprintf(buf, 256, "Jag #%d firmware (%d) is not FIRST approved (must be at least version 108 of the FIRST approved firmware)", m_deviceNumber, m_firmwareVersion);
}
wpi_setWPIErrorWithContext(JaguarVersionError, buf);
return;

View File

@@ -217,6 +217,20 @@ public class CANJaguar implements MotorSafety, PIDOutput, SpeedController, LiveW
// Not all Jaguar firmware reports a hardware version.
m_hardwareVersion = 0;
}
// 3330 was the first shipping RDK firmware version for the Jaguar
if (m_firmwareVersion >= 3330 || m_firmwareVersion < 108)
{
if (m_firmwareVersion < 3330)
{
DriverStation.reportError("Jag " + m_deviceNumber + " firmware " + m_firmwareVersion + " is too old (must be at least version 108 of the FIRST approved firmware)", false);
}
else
{
DriverStation.reportError("Jag" + m_deviceNumber + " firmware " + m_firmwareVersion + " is not FIRST approved (must be at least version 108 of the FIRST approved firmware)", false);
}
return;
}
}
/**