Update MOVThread.cpp
This commit is contained in:
@@ -33,7 +33,7 @@ void detectAccelerometerVersion() {
|
|||||||
#ifdef ACCEL_MMA
|
#ifdef ACCEL_MMA
|
||||||
if (MMA8652FC::detect()) {
|
if (MMA8652FC::detect()) {
|
||||||
if (MMA8652FC::initalize()) {
|
if (MMA8652FC::initalize()) {
|
||||||
DetectedAccelerometerVersion = "MMA";
|
DetectedAccelerometerVersion = MMA;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
@@ -41,7 +41,7 @@ void detectAccelerometerVersion() {
|
|||||||
if (LIS2DH12::detect()) {
|
if (LIS2DH12::detect()) {
|
||||||
// Setup the ST Accelerometer
|
// Setup the ST Accelerometer
|
||||||
if (LIS2DH12::initalize()) {
|
if (LIS2DH12::initalize()) {
|
||||||
DetectedAccelerometerVersion = "LIS";
|
DetectedAccelerometerVersion = LIS;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
@@ -49,7 +49,7 @@ void detectAccelerometerVersion() {
|
|||||||
if (BMA223::detect()) {
|
if (BMA223::detect()) {
|
||||||
// Setup the BMA223 Accelerometer
|
// Setup the BMA223 Accelerometer
|
||||||
if (BMA223::initalize()) {
|
if (BMA223::initalize()) {
|
||||||
DetectedAccelerometerVersion = "BMA";
|
DetectedAccelerometerVersion = BMA;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
@@ -57,7 +57,7 @@ void detectAccelerometerVersion() {
|
|||||||
if (MSA301::detect()) {
|
if (MSA301::detect()) {
|
||||||
// Setup the MSA301 Accelerometer
|
// Setup the MSA301 Accelerometer
|
||||||
if (MSA301::initalize()) {
|
if (MSA301::initalize()) {
|
||||||
DetectedAccelerometerVersion = "MSA";
|
DetectedAccelerometerVersion = MSA;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
@@ -65,7 +65,7 @@ void detectAccelerometerVersion() {
|
|||||||
if (SC7A20::detect()) {
|
if (SC7A20::detect()) {
|
||||||
// Setup the SC7A20 Accelerometer
|
// Setup the SC7A20 Accelerometer
|
||||||
if (SC7A20::initalize()) {
|
if (SC7A20::initalize()) {
|
||||||
DetectedAccelerometerVersion = "SC7";
|
DetectedAccelerometerVersion = SC7;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
@@ -77,31 +77,31 @@ void detectAccelerometerVersion() {
|
|||||||
}
|
}
|
||||||
inline void readAccelerometer(int16_t &tx, int16_t &ty, int16_t &tz, Orientation &rotation) {
|
inline void readAccelerometer(int16_t &tx, int16_t &ty, int16_t &tz, Orientation &rotation) {
|
||||||
#ifdef ACCEL_MMA
|
#ifdef ACCEL_MMA
|
||||||
if (DetectedAccelerometerVersion == "MMA") {
|
if (DetectedAccelerometerVersion == MMA) {
|
||||||
MMA8652FC::getAxisReadings(tx, ty, tz);
|
MMA8652FC::getAxisReadings(tx, ty, tz);
|
||||||
rotation = MMA8652FC::getOrientation();
|
rotation = MMA8652FC::getOrientation();
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
#ifdef ACCEL_LIS
|
#ifdef ACCEL_LIS
|
||||||
if (DetectedAccelerometerVersion == "LIS") {
|
if (DetectedAccelerometerVersion == LIS) {
|
||||||
LIS2DH12::getAxisReadings(tx, ty, tz);
|
LIS2DH12::getAxisReadings(tx, ty, tz);
|
||||||
rotation = LIS2DH12::getOrientation();
|
rotation = LIS2DH12::getOrientation();
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
#ifdef ACCEL_BMA
|
#ifdef ACCEL_BMA
|
||||||
if (DetectedAccelerometerVersion == "BMA") {
|
if (DetectedAccelerometerVersion == BMA) {
|
||||||
BMA223::getAxisReadings(tx, ty, tz);
|
BMA223::getAxisReadings(tx, ty, tz);
|
||||||
rotation = BMA223::getOrientation();
|
rotation = BMA223::getOrientation();
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
#ifdef ACCEL_MSA
|
#ifdef ACCEL_MSA
|
||||||
if (DetectedAccelerometerVersion == "MSA") {
|
if (DetectedAccelerometerVersion == MSA) {
|
||||||
MSA301::getAxisReadings(tx, ty, tz);
|
MSA301::getAxisReadings(tx, ty, tz);
|
||||||
rotation = MSA301::getOrientation();
|
rotation = MSA301::getOrientation();
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
#ifdef ACCEL_SC7
|
#ifdef ACCEL_SC7
|
||||||
if (DetectedAccelerometerVersion == "SC7") {
|
if (DetectedAccelerometerVersion == SC7) {
|
||||||
SC7A20::getAxisReadings(tx, ty, tz);
|
SC7A20::getAxisReadings(tx, ty, tz);
|
||||||
rotation = SC7A20::getOrientation();
|
rotation = SC7A20::getOrientation();
|
||||||
} else
|
} else
|
||||||
|
|||||||
Reference in New Issue
Block a user