diff options
author | Ben V. Brown <[email protected]> | 2022-02-12 18:25:52 +1100 |
---|---|---|
committer | Ben V. Brown <[email protected]> | 2022-02-12 18:25:52 +1100 |
commit | e065be37d90e87272566eaf30691f7f0576523ca (patch) | |
tree | 119a87dd541d53b03ee8aa00e6ddcb63bd834be7 /source | |
parent | 5fd255969ca95017e4f4e6239f1d7223086cd194 (diff) | |
download | IronOS-e065be37d90e87272566eaf30691f7f0576523ca.tar.gz IronOS-e065be37d90e87272566eaf30691f7f0576523ca.zip |
Force SC7 to probe last
Diffstat (limited to 'source')
-rw-r--r-- | source/Core/Threads/MOVThread.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/source/Core/Threads/MOVThread.cpp b/source/Core/Threads/MOVThread.cpp index 1e62a2b7..b7235649 100644 --- a/source/Core/Threads/MOVThread.cpp +++ b/source/Core/Threads/MOVThread.cpp @@ -27,18 +27,10 @@ #define MOVFilter 8
uint8_t accelInit = 0;
TickType_t lastMovementTime = 0;
-
+// Order matters for probe order, some Acceleromters do NOT like bad reads; and we have a bunch of overlap of addresses
void detectAccelerometerVersion() {
DetectedAccelerometerVersion = AccelType::Scanning;
-#ifdef ACCEL_SC7
- if (SC7A20::detect()) {
- // Setup the SC7A20 Accelerometer
- if (SC7A20::initalize()) {
- DetectedAccelerometerVersion = AccelType::SC7;
- return;
- }
- }
-#endif
+
#ifdef ACCEL_MMA
if (MMA8652FC::detect()) {
if (MMA8652FC::initalize()) {
@@ -65,6 +57,15 @@ void detectAccelerometerVersion() { }
}
#endif
+#ifdef ACCEL_SC7
+ if (SC7A20::detect()) {
+ // Setup the SC7A20 Accelerometer
+ if (SC7A20::initalize()) {
+ DetectedAccelerometerVersion = AccelType::SC7;
+ return;
+ }
+ }
+#endif
#ifdef ACCEL_MSA
if (MSA301::detect()) {
// Setup the MSA301 Accelerometer
|