From e4383b5a36872d630bcc0da53ac6c55bc0bcf160 Mon Sep 17 00:00:00 2001 From: mikeller Date: Sun, 30 Dec 2018 01:31:06 +1300 Subject: [PATCH] Simplified conditionals for using gyro data analysis. --- src/main/fc/core.c | 4 ++-- src/main/io/osd.c | 4 ++-- src/main/target/common_post.h | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/fc/core.c b/src/main/fc/core.c index 93dec31d4e..6f01bf5d45 100644 --- a/src/main/fc/core.c +++ b/src/main/fc/core.c @@ -51,7 +51,7 @@ #include "sensors/boardalignment.h" #include "sensors/gyro.h" #include "sensors/sensors.h" -#if (!defined(SIMULATOR_BUILD) && !defined(UNIT_TEST)) +#if defined(USE_GYRO_DATA_ANALYSE) #include "sensors/gyroanalyse.h" #endif #include "fc/config.h" @@ -439,7 +439,7 @@ void tryArm(void) } imuQuaternionHeadfreeOffsetSet(); -#if (!defined(SIMULATOR_BUILD) && !defined(UNIT_TEST) && defined(USE_GYRO_DATA_ANALYSE)) +#if defined(USE_GYRO_DATA_ANALYSE) resetMaxFFT(); #endif diff --git a/src/main/io/osd.c b/src/main/io/osd.c index 9b6f123538..d7a24c9eca 100644 --- a/src/main/io/osd.c +++ b/src/main/io/osd.c @@ -95,7 +95,7 @@ #include "sensors/battery.h" #include "sensors/esc_sensor.h" #include "sensors/sensors.h" -#if (!defined(SIMULATOR_BUILD) && !defined(UNIT_TEST) && defined(USE_GYRO_DATA_ANALYSE)) +#if defined(USE_GYRO_DATA_ANALYSE) #include "sensors/gyroanalyse.h" #endif @@ -1824,7 +1824,7 @@ static void osdShowStats(uint16_t endBatteryVoltage) } #endif -#if (!defined(SIMULATOR_BUILD) && !defined(UNIT_TEST) && defined(USE_GYRO_DATA_ANALYSE)) +#if defined(USE_GYRO_DATA_ANALYSE) if (osdStatGetState(OSD_STAT_MAX_FFT) && featureIsEnabled(FEATURE_DYNAMIC_FILTER)) { int value = getMaxFFT(); if (value > 0) { diff --git a/src/main/target/common_post.h b/src/main/target/common_post.h index a5b3f6f9aa..c2aa322b3f 100644 --- a/src/main/target/common_post.h +++ b/src/main/target/common_post.h @@ -233,3 +233,8 @@ #if defined(USE_SERIAL_4WAY_SK_BOOTLOADER) && !defined(USE_SERIAL_4WAY_BLHELI_BOOTLOADER) #define USE_SERIAL_4WAY_BLHELI_BOOTLOADER #endif + +#if defined(SIMULATOR_BUILD) || defined(UNIT_TEST) +// This feature uses 'arm_math.h', which does not exist for x86. +#undef USE_GYRO_DATA_ANALYSE +#endif