From ba298eebb5ae7692772a5be7b2e303e2b0a73742 Mon Sep 17 00:00:00 2001 From: blckmn Date: Sun, 2 Jul 2017 10:49:45 +1000 Subject: [PATCH] Moving gyro to rest of hardware in settings.c --- src/main/fc/cli.c | 8 +------- src/main/fc/settings.c | 9 ++++++++- src/main/fc/settings.h | 3 +++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/fc/cli.c b/src/main/fc/cli.c index 66033bd951..ebdadfda3f 100755 --- a/src/main/fc/cli.c +++ b/src/main/fc/cli.c @@ -182,14 +182,8 @@ static const char * const sensorTypeNames[] = { #define SENSOR_NAMES_MASK (SENSOR_GYRO | SENSOR_ACC | SENSOR_BARO | SENSOR_MAG) -// sync with gyroSensor_e -static const char * const gyroNames[] = { - "AUTO", "NONE", "MPU6050", "L3G4200D", "MPU3050", "L3GD20", - "MPU6000", "MPU6500", "MPU9250", "ICM20601", "ICM20602", "ICM20608G", "ICM20689", "BMI160", "FAKE" -}; - static const char * const *sensorHardwareNames[] = { - gyroNames, lookupTableAccHardware, lookupTableBaroHardware, lookupTableMagHardware + lookupTableGyroHardware, lookupTableAccHardware, lookupTableBaroHardware, lookupTableMagHardware }; #endif // USE_SENSOR_NAMES diff --git a/src/main/fc/settings.c b/src/main/fc/settings.c index e29d9ff5e0..8f3a028ec5 100644 --- a/src/main/fc/settings.c +++ b/src/main/fc/settings.c @@ -74,13 +74,19 @@ #include "telemetry/frsky.h" #include "telemetry/telemetry.h" - // Sensor names (used in lookup tables for *_hardware settings and in status command output) // sync with accelerationSensor_e const char * const lookupTableAccHardware[] = { "AUTO", "NONE", "ADXL345", "MPU6050", "MMA8452", "BMA280", "LSM303DLHC", "MPU6000", "MPU6500", "MPU9250", "ICM20601", "ICM20602", "ICM20608", "ICM20689", "BMI160", "FAKE" }; + +// sync with gyroSensor_e +const char * const lookupTableGyroHardware[] = { + "AUTO", "NONE", "MPU6050", "L3G4200D", "MPU3050", "L3GD20", + "MPU6000", "MPU6500", "MPU9250", "ICM20601", "ICM20602", "ICM20608G", "ICM20689", "BMI160", "FAKE" +}; + #if defined(USE_SENSOR_NAMES) || defined(BARO) // sync with baroSensor_e const char * const lookupTableBaroHardware[] = { @@ -272,6 +278,7 @@ const lookupTableEntry_t lookupTables[] = { { lookupTableRxSpi, sizeof(lookupTableRxSpi) / sizeof(char *) }, #endif { lookupTableGyroLpf, sizeof(lookupTableGyroLpf) / sizeof(char *) }, + { lookupTableGyroHardware, sizeof(lookupTableGyroHardware) / sizeof(char *) }, { lookupTableAccHardware, sizeof(lookupTableAccHardware) / sizeof(char *) }, #ifdef BARO { lookupTableBaroHardware, sizeof(lookupTableBaroHardware) / sizeof(char *) }, diff --git a/src/main/fc/settings.h b/src/main/fc/settings.h index 52ddb0a3f5..a9f05e5803 100644 --- a/src/main/fc/settings.h +++ b/src/main/fc/settings.h @@ -41,6 +41,7 @@ typedef enum { TABLE_RX_SPI, #endif TABLE_GYRO_LPF, + TABLE_GYRO_HARDWARE, TABLE_ACC_HARDWARE, #ifdef BARO TABLE_BARO_HARDWARE, @@ -130,6 +131,8 @@ extern const uint16_t valueTableEntryCount; extern const clivalue_t valueTable[]; //extern const uint8_t lookupTablesEntryCount; +extern const char * const lookupTableGyroHardware[]; + extern const char * const lookupTableAccHardware[]; //extern const uint8_t lookupTableAccHardwareEntryCount;