mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[wpilib] ADIS164xx: report product ID on mismatch (#7706)
This commit is contained in:
@@ -425,8 +425,9 @@ public class ADIS16448_IMU implements AutoCloseable, Sendable {
|
||||
}
|
||||
readRegister(PROD_ID); // Dummy read
|
||||
// Validate the product ID
|
||||
if (readRegister(PROD_ID) != 16448) {
|
||||
DriverStation.reportError("Could not find ADIS16448", false);
|
||||
int prodId = readRegister(PROD_ID);
|
||||
if (prodId != 16448) {
|
||||
DriverStation.reportError("Could not find ADIS16448; got product ID " + prodId, false);
|
||||
close();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -485,7 +485,7 @@ public class ADIS16470_IMU implements AutoCloseable, Sendable {
|
||||
// Validate the product ID
|
||||
int prodId = readRegister(PROD_ID);
|
||||
if (prodId != 16982 && prodId != 16470) {
|
||||
DriverStation.reportError("Could not find an ADIS16470", false);
|
||||
DriverStation.reportError("Could not find an ADIS16470; got product ID " + prodId, false);
|
||||
close();
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user