Move I2C initalisations into more logical spots
This commit is contained in:
@@ -632,6 +632,7 @@ void showDebugMenu(void) {
|
||||
uint8_t idleScreenBGF[sizeof(idleScreenBG)];
|
||||
/* StartGUITask function */
|
||||
void startGUITask(void const *argument __unused) {
|
||||
OLED::initialize(); // start up the LCD
|
||||
|
||||
uint8_t tempWarningState = 0;
|
||||
bool buttonLockout = false;
|
||||
|
||||
@@ -23,8 +23,28 @@
|
||||
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);
|
||||
|
||||
lastMovementTime = 0;
|
||||
int16_t datax[MOVFilter] = { 0 };
|
||||
int16_t datay[MOVFilter] = { 0 };
|
||||
|
||||
Reference in New Issue
Block a user