1
0
forked from me/IronOS

Backport some master changes

This commit is contained in:
Ben V. Brown
2020-09-17 19:05:55 +10:00
parent b4c8fc2aab
commit 8074255b9e
23 changed files with 754 additions and 581 deletions

View File

@@ -23,8 +23,34 @@
uint8_t accelInit = 0;
uint32_t lastMovementTime = 0;
void startMOVTask(void const *argument __unused) {
OLED::setRotation(systemSettings.OrientationMode & 1);
#ifdef ACCEL_MMA
if (MMA8652FC::detect()) {
PCBVersion = 1;
MMA8652FC::initalize(); // this sets up the I2C registers
} else
#endif
#ifdef ACCEL_LIS
if (LIS2DH12::detect()) {
PCBVersion = 2;
// Setup the ST Accelerometer
LIS2DH12::initalize(); // startup the accelerometer
} else
#endif
{
PCBVersion = 3;
systemSettings.SleepTime = 0;
systemSettings.ShutdownTime = 0; // No accel -> disable sleep
systemSettings.sensitivity = 0;
}
postRToSInit();
OLED::setRotation(systemSettings.OrientationMode & 1);
if ((PCBVersion == 1
|| PCBVersion == 2)
&& (systemSettings.autoStartMode == 2
|| systemSettings.autoStartMode == 3))
osDelay(2000);
lastMovementTime = 0;
int16_t datax[MOVFilter] = { 0 };
int16_t datay[MOVFilter] = { 0 };