1
0
forked from me/IronOS

Add warnings to show if accel or pd is missing on startup first 2 times

This commit is contained in:
Ben V. Brown
2021-01-01 09:56:52 +11:00
parent 120161857b
commit 17fe108432
7 changed files with 62 additions and 58 deletions

View File

@@ -24,6 +24,7 @@
uint8_t accelInit = 0;
TickType_t lastMovementTime = 0;
void detectAccelerometerVersion() {
DetectedAccelerometerVersion = ACCELEROMETERS_SCANNING;
#ifdef ACCEL_MMA
if (MMA8652FC::detect()) {
DetectedAccelerometerVersion = 1;
@@ -83,16 +84,11 @@ inline void readAccelerometer(int16_t &tx, int16_t &ty, int16_t &tz, Orientation
}
void startMOVTask(void const *argument __unused) {
postRToSInit();
while (OLED::isInitDone() == false) {
osDelay(1); //Make oled init happen first
}
OLED::setRotation(systemSettings.OrientationMode & 1);
detectAccelerometerVersion();
lastMovementTime = 0;
if ((systemSettings.autoStartMode == 2 || systemSettings.autoStartMode == 3))
osDelay(2 * TICKS_SECOND);
lastMovementTime = 0;
int16_t datax[MOVFilter] = { 0 };
int16_t datay[MOVFilter] = { 0 };
int16_t dataz[MOVFilter] = { 0 };
@@ -102,17 +98,6 @@ void startMOVTask(void const *argument __unused) {
if (systemSettings.sensitivity > 9)
systemSettings.sensitivity = 9;
Orientation rotation = ORIENTATION_FLAT;
// OLED::setFont(1);
// for (;;) {
// OLED::clearScreen();
// OLED::setCursor(0, 0);
// readAccelerometer(tx, ty, tz, rotation);
// OLED::printNumber(tx, 5, 0);
// OLED::setCursor(0, 8);
// OLED::printNumber(xTaskGetTickCount() / 10, 5, 1);
// OLED::refresh();
// osDelay(50);
// }
for (;;) {
int32_t threshold = 1500 + (9 * 200);
threshold -= systemSettings.sensitivity * 200; // 200 is the step size