Link into MOV thread

This commit is contained in:
Ben V. Brown
2021-01-15 22:07:26 +11:00
parent 7ba2bda275
commit df2f97a1de
2 changed files with 16 additions and 0 deletions

View File

@@ -23,6 +23,7 @@
#define ENABLE_QC2
#define TEMP_TMP36
#define ACCEL_BMA
#define ACCEL_SC7
#define HALL_SENSOR
#define HALL_SI7210
#define BATTFILTERDEPTH 32

View File

@@ -21,6 +21,7 @@
#include "power.hpp"
#include "stdlib.h"
#include "task.h"
#include "SC7A20.hpp"
#define MOVFilter 8
uint8_t accelInit = 0;
TickType_t lastMovementTime = 0;
@@ -56,6 +57,14 @@ void detectAccelerometerVersion() {
DetectedAccelerometerVersion = 4;
}
} else
#endif
#ifdef ACCEL_SC7
if (SC7A20::detect()) {
// Setup the SC7A20 Accelerometer
if (SC7A20::initalize()) {
DetectedAccelerometerVersion = 5;
}
} else
#endif
{
// disable imu sensitivity
@@ -86,6 +95,12 @@ inline void readAccelerometer(int16_t &tx, int16_t &ty, int16_t &tz, Orientation
MSA301::getAxisReadings(tx, ty, tz);
rotation = MSA301::getOrientation();
} else
#endif
#ifdef ACCEL_SC7
if (DetectedAccelerometerVersion == 5) {
SC7A20::getAxisReadings(tx, ty, tz);
rotation = SC7A20::getOrientation();
} else
#endif
{
// do nothing :(