mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Link into MOV thread
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 :(
|
||||
|
||||
Reference in New Issue
Block a user