Link MSA301 into normal MOV handler
This commit is contained in:
@@ -36,6 +36,7 @@
|
|||||||
|
|
||||||
#ifdef MODEL_TS80P
|
#ifdef MODEL_TS80P
|
||||||
#define ACCEL_LIS
|
#define ACCEL_LIS
|
||||||
|
#define ACCEL_MSA
|
||||||
#define POW_PD
|
#define POW_PD
|
||||||
#define POW_QC
|
#define POW_QC
|
||||||
#define TEMP_NTC
|
#define TEMP_NTC
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include "I2C_Wrapper.hpp"
|
#include "I2C_Wrapper.hpp"
|
||||||
#include "LIS2DH12.hpp"
|
#include "LIS2DH12.hpp"
|
||||||
#include "MMA8652FC.hpp"
|
#include "MMA8652FC.hpp"
|
||||||
|
#include "MSA301.h"
|
||||||
#include "QC3.h"
|
#include "QC3.h"
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
#include "TipThermoModel.h"
|
#include "TipThermoModel.h"
|
||||||
@@ -24,36 +25,41 @@
|
|||||||
uint8_t accelInit = 0;
|
uint8_t accelInit = 0;
|
||||||
TickType_t lastMovementTime = 0;
|
TickType_t lastMovementTime = 0;
|
||||||
void detectAccelerometerVersion() {
|
void detectAccelerometerVersion() {
|
||||||
|
PCBVersion = 99;
|
||||||
#ifdef ACCEL_MMA
|
#ifdef ACCEL_MMA
|
||||||
if (MMA8652FC::detect()) {
|
if (MMA8652FC::detect()) {
|
||||||
PCBVersion = 1;
|
|
||||||
if (!MMA8652FC::initalize()) {
|
if (MMA8652FC::initalize()) {
|
||||||
PCBVersion = 99;
|
PCBVersion = 1;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
#ifdef ACCEL_LIS
|
#ifdef ACCEL_LIS
|
||||||
if (LIS2DH12::detect()) {
|
if (LIS2DH12::detect()) {
|
||||||
PCBVersion = 2;
|
|
||||||
// Setup the ST Accelerometer
|
// Setup the ST Accelerometer
|
||||||
if (!LIS2DH12::initalize()) {
|
if (LIS2DH12::initalize()) {
|
||||||
PCBVersion = 99;
|
PCBVersion = 2;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
#ifdef ACCEL_BMA
|
#ifdef ACCEL_BMA
|
||||||
if (BMA223::detect()) {
|
if (BMA223::detect()) {
|
||||||
PCBVersion = 3;
|
|
||||||
// Setup the ST Accelerometer
|
// Setup the ST Accelerometer
|
||||||
if (!BMA223::initalize()) {
|
if (BMA223::initalize()) {
|
||||||
PCBVersion = 99;
|
PCBVersion = 3;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
#endif
|
||||||
|
#ifdef ACCEL_MSA
|
||||||
|
if (MSA301::detect()) {
|
||||||
|
// Setup the MSA301 Accelerometer
|
||||||
|
if (MSA301::initalize()) {
|
||||||
|
PCBVersion = 4;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
PCBVersion = 99;
|
//disable imu sensitivity
|
||||||
systemSettings.SleepTime = 0;
|
|
||||||
systemSettings.ShutdownTime = 0; // No accel -> disable sleep
|
|
||||||
systemSettings.sensitivity = 0;
|
systemSettings.sensitivity = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user