From 87b077b59bcec2347396c93a86cd3e07eaada0a0 Mon Sep 17 00:00:00 2001 From: Bruce Luckcuck Date: Thu, 31 Jan 2019 07:53:56 -0500 Subject: [PATCH] Fix compiliation for F1 targets Fix a missing MCU check for ADC devices and reduce the number of profiles/rateprofiles to 2 and 3 respectively to get the config under 2K. --- src/main/fc/controlrate_profile.h | 2 -- src/main/pg/adc.c | 2 ++ src/main/target/common_pre.h | 4 +++- src/test/unit/platform.h | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/fc/controlrate_profile.h b/src/main/fc/controlrate_profile.h index bd2f042dd5..a3cb80625e 100644 --- a/src/main/fc/controlrate_profile.h +++ b/src/main/fc/controlrate_profile.h @@ -24,8 +24,6 @@ #include "pg/pg.h" -#define CONTROL_RATE_PROFILE_COUNT 6 - typedef enum { RATES_TYPE_BETAFLIGHT = 0, RATES_TYPE_RACEFLIGHT, diff --git a/src/main/pg/adc.c b/src/main/pg/adc.c index 30ba901c60..692f48ad89 100644 --- a/src/main/pg/adc.c +++ b/src/main/pg/adc.c @@ -41,8 +41,10 @@ void pgResetFn_adcConfig(adcConfig_t *adcConfig) { adcConfig->device = ADC_DEV_TO_CFG(adcDeviceByInstance(ADC_INSTANCE)); adcConfig->dmaopt[ADCDEV_1] = ADC1_DMA_OPT; +#ifndef STM32F1 adcConfig->dmaopt[ADCDEV_2] = ADC2_DMA_OPT; adcConfig->dmaopt[ADCDEV_3] = ADC3_DMA_OPT; +#endif #ifdef VBAT_ADC_PIN adcConfig->vbat.enabled = true; diff --git a/src/main/target/common_pre.h b/src/main/target/common_pre.h index 9419a5b442..cae2fa110d 100644 --- a/src/main/target/common_pre.h +++ b/src/main/target/common_pre.h @@ -145,10 +145,12 @@ #define USE_SERIALRX_SPEKTRUM // SRXL, DSM2 and DSMX protocol #define USE_SERIALRX_SUMD // Graupner Hott protocol -#if (FLASH_SIZE > 64) +#if (FLASH_SIZE > 128) #define PID_PROFILE_COUNT 3 +#define CONTROL_RATE_PROFILE_COUNT 6 #else #define PID_PROFILE_COUNT 2 +#define CONTROL_RATE_PROFILE_COUNT 3 #endif #if (FLASH_SIZE > 64) diff --git a/src/test/unit/platform.h b/src/test/unit/platform.h index 5c9ae1aa5e..52ccf5e937 100644 --- a/src/test/unit/platform.h +++ b/src/test/unit/platform.h @@ -33,6 +33,7 @@ #define FAST_RAM #define PID_PROFILE_COUNT 3 +#define CONTROL_RATE_PROFILE_COUNT 6 #define USE_MAG #define USE_BARO #define USE_GPS