From 36c53667cd3997bc09376345422515633ebd4c2e Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 4 Dec 2014 13:09:54 -0500 Subject: [PATCH] Require Jaguar version v108 or higher. Change-Id: Ib3a29a9182a776771db8b45bf82df3168e800277 --- wpilibc/wpilibC++Devices/src/CANJaguar.cpp | 6 +++--- .../main/java/edu/wpi/first/wpilibj/CANJaguar.java | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/wpilibc/wpilibC++Devices/src/CANJaguar.cpp b/wpilibc/wpilibC++Devices/src/CANJaguar.cpp index e39f2bbad5..ba49138cb7 100644 --- a/wpilibc/wpilibC++Devices/src/CANJaguar.cpp +++ b/wpilibc/wpilibC++Devices/src/CANJaguar.cpp @@ -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; diff --git a/wpilibj/wpilibJavaDevices/src/main/java/edu/wpi/first/wpilibj/CANJaguar.java b/wpilibj/wpilibJavaDevices/src/main/java/edu/wpi/first/wpilibj/CANJaguar.java index 6d1213d6d1..c16295a4c7 100644 --- a/wpilibj/wpilibJavaDevices/src/main/java/edu/wpi/first/wpilibj/CANJaguar.java +++ b/wpilibj/wpilibJavaDevices/src/main/java/edu/wpi/first/wpilibj/CANJaguar.java @@ -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; + } } /**