From 5904314a7503aec02fd537a5f3e301c1228a976b Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 3 Mar 2016 23:06:00 -0800 Subject: [PATCH] Improve ADXRS450 error detection. Ensure the POR, PWR, and CST error bits are not set when reading the sample. Reported by: Jared Russell, Austin Schuh Change-Id: Ib38178d6b51880480aee86e13c16f9ba89a80693 --- wpilibc/Athena/src/ADXRS450_Gyro.cpp | 2 +- .../src/athena/java/edu/wpi/first/wpilibj/ADXRS450_Gyro.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wpilibc/Athena/src/ADXRS450_Gyro.cpp b/wpilibc/Athena/src/ADXRS450_Gyro.cpp index a1ec4e3e77..00090bba27 100644 --- a/wpilibc/Athena/src/ADXRS450_Gyro.cpp +++ b/wpilibc/Athena/src/ADXRS450_Gyro.cpp @@ -69,7 +69,7 @@ ADXRS450_Gyro::ADXRS450_Gyro(SPI::Port port) : m_spi(port) { return; } - m_spi.InitAccumulator(kSamplePeriod, 0x20000000u, 4, 0x0c000000u, 0x04000000u, + m_spi.InitAccumulator(kSamplePeriod, 0x20000000u, 4, 0x0c00000eu, 0x04000000u, 10u, 16u, true, true); Calibrate(); diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/ADXRS450_Gyro.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/ADXRS450_Gyro.java index b5c6b255b6..4f05874541 100644 --- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/ADXRS450_Gyro.java +++ b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/ADXRS450_Gyro.java @@ -74,7 +74,7 @@ public class ADXRS450_Gyro extends GyroBase implements Gyro, PIDSource, LiveWind return; } - m_spi.initAccumulator(kSamplePeriod, 0x20000000, 4, 0x0c000000, 0x04000000, + m_spi.initAccumulator(kSamplePeriod, 0x20000000, 4, 0x0c00000e, 0x04000000, 10, 16, true, true); calibrate();