Update MOVThread.cpp

This commit is contained in:
discip
2021-09-25 00:43:52 +02:00
committed by GitHub
parent 343ef02d03
commit 2467e6f004

View File

@@ -33,7 +33,7 @@ void detectAccelerometerVersion() {
#ifdef ACCEL_MMA
if (MMA8652FC::detect()) {
if (MMA8652FC::initalize()) {
DetectedAccelerometerVersion = MMA;
DetectedAccelerometerVersion = "MMA";
}
} else
#endif
@@ -41,7 +41,7 @@ void detectAccelerometerVersion() {
if (LIS2DH12::detect()) {
// Setup the ST Accelerometer
if (LIS2DH12::initalize()) {
DetectedAccelerometerVersion = LIS;
DetectedAccelerometerVersion = "LIS";
}
} else
#endif
@@ -49,7 +49,7 @@ void detectAccelerometerVersion() {
if (BMA223::detect()) {
// Setup the BMA223 Accelerometer
if (BMA223::initalize()) {
DetectedAccelerometerVersion = BMA;
DetectedAccelerometerVersion = "BMA";
}
} else
#endif
@@ -57,7 +57,7 @@ void detectAccelerometerVersion() {
if (MSA301::detect()) {
// Setup the MSA301 Accelerometer
if (MSA301::initalize()) {
DetectedAccelerometerVersion = MSA;
DetectedAccelerometerVersion = "MSA";
}
} else
#endif
@@ -65,7 +65,7 @@ void detectAccelerometerVersion() {
if (SC7A20::detect()) {
// Setup the SC7A20 Accelerometer
if (SC7A20::initalize()) {
DetectedAccelerometerVersion = SC7;
DetectedAccelerometerVersion = "SC7";
}
} else
#endif
@@ -76,32 +76,32 @@ void detectAccelerometerVersion() {
}
}
inline void readAccelerometer(int16_t &tx, int16_t &ty, int16_t &tz, Orientation &rotation) {
#ifdef ACCEL_LIS
if (DetectedAccelerometerVersion == 2) {
LIS2DH12::getAxisReadings(tx, ty, tz);
rotation = LIS2DH12::getOrientation();
} else
#endif
#ifdef ACCEL_MMA
if (DetectedAccelerometerVersion == 1) {
if (DetectedAccelerometerVersion == "MMA") {
MMA8652FC::getAxisReadings(tx, ty, tz);
rotation = MMA8652FC::getOrientation();
} else
#endif
#ifdef ACCEL_LIS
if (DetectedAccelerometerVersion == "LIS") {
LIS2DH12::getAxisReadings(tx, ty, tz);
rotation = LIS2DH12::getOrientation();
} else
#endif
#ifdef ACCEL_BMA
if (DetectedAccelerometerVersion == 3) {
if (DetectedAccelerometerVersion == "BMA") {
BMA223::getAxisReadings(tx, ty, tz);
rotation = BMA223::getOrientation();
} else
#endif
#ifdef ACCEL_MSA
if (DetectedAccelerometerVersion == 4) {
if (DetectedAccelerometerVersion == "MSA") {
MSA301::getAxisReadings(tx, ty, tz);
rotation = MSA301::getOrientation();
} else
#endif
#ifdef ACCEL_SC7
if (DetectedAccelerometerVersion == 5) {
if (DetectedAccelerometerVersion == "SC7") {
SC7A20::getAxisReadings(tx, ty, tz);
rotation = SC7A20::getOrientation();
} else