1
0
forked from me/IronOS

Fix enum annocations

This commit is contained in:
Ben V. Brown
2021-09-25 10:31:17 +10:00
parent 0619ada6d9
commit 04fce5d669
2 changed files with 4 additions and 6 deletions

View File

@@ -768,11 +768,11 @@ void showWarnings() {
// We also want to alert if accel or pd is not detected / not responding // We also want to alert if accel or pd is not detected / not responding
// In this case though, we dont want to nag the user _too_ much // In this case though, we dont want to nag the user _too_ much
// So only show first 2 times // So only show first 2 times
while (DetectedAccelerometerVersion == ACCELEROMETERS_SCANNING) { while (DetectedAccelerometerVersion == AccelType::Scanning) {
osDelay(5); osDelay(5);
} }
// Display alert if accelerometer is not detected // Display alert if accelerometer is not detected
if (DetectedAccelerometerVersion == NO_DETECTED_ACCELEROMETER) { if (DetectedAccelerometerVersion == AccelType::None) {
if (getSettingValue(SettingsOptions::AccelMissingWarningCounter) < 2) { if (getSettingValue(SettingsOptions::AccelMissingWarningCounter) < 2) {
nextSettingValue(SettingsOptions::AccelMissingWarningCounter); nextSettingValue(SettingsOptions::AccelMissingWarningCounter);
saveSettings(); saveSettings();

View File

@@ -24,14 +24,12 @@
#include "stdlib.h" #include "stdlib.h"
#include "task.h" #include "task.h"
enum class AccelType { MMA = 1, LIS = 2, BMA = 3, MSA = 4, SC7 = 5, None = 99 };
#define MOVFilter 8 #define MOVFilter 8
uint8_t accelInit = 0; uint8_t accelInit = 0;
TickType_t lastMovementTime = 0; TickType_t lastMovementTime = 0;
void detectAccelerometerVersion() { void detectAccelerometerVersion() {
DetectedAccelerometerVersion = ACCELEROMETERS_SCANNING; DetectedAccelerometerVersion = AccelType::Scanning;
#ifdef ACCEL_MMA #ifdef ACCEL_MMA
if (MMA8652FC::detect()) { if (MMA8652FC::detect()) {
if (MMA8652FC::initalize()) { if (MMA8652FC::initalize()) {
@@ -74,7 +72,7 @@ void detectAccelerometerVersion() {
{ {
// disable imu sensitivity // disable imu sensitivity
setSettingValue(SettingsOptions::Sensitivity, 0); setSettingValue(SettingsOptions::Sensitivity, 0);
DetectedAccelerometerVersion = NO_DETECTED_ACCELEROMETER; DetectedAccelerometerVersion = AccelType::None;
} }
} }
inline void readAccelerometer(int16_t &tx, int16_t &ty, int16_t &tz, Orientation &rotation) { inline void readAccelerometer(int16_t &tx, int16_t &ty, int16_t &tz, Orientation &rotation) {