From d148ffcaa69ce693de8ca4625b24e9cd24442f1f Mon Sep 17 00:00:00 2001 From: Martin Budden Date: Tue, 21 Feb 2017 08:07:33 +0000 Subject: [PATCH] Rationalised target.h files by moving common items into common.h --- src/main/target/AIR32/target.h | 2 - src/main/target/AIRHEROF3/target.h | 2 - src/main/target/ALIENFLIGHTF1/target.h | 2 - src/main/target/CC3D/target.h | 1 - src/main/target/FISHDRONEF4/target.h | 1 - src/main/target/MICROSCISKY/target.h | 1 - src/main/target/MOTOLAB/target.h | 2 - src/main/target/NAZE/target.h | 2 - src/main/target/OMNIBUS/target.h | 2 - src/main/target/PIKOBLX/target.h | 6 --- src/main/target/RACEBASE/target.h | 2 - src/main/target/RCEXPLORERF3/target.h | 7 --- src/main/target/REVONANO/target.h | 7 --- src/main/target/RG_SSD_F3/target.h | 6 --- src/main/target/SIRINFPV/target.h | 2 - src/main/target/SPRACINGF3NEO/target.h | 2 - src/main/target/common.h | 69 ++++++++++++-------------- src/test/unit/platform.h | 2 +- src/test/unit/target.h | 2 +- 19 files changed, 34 insertions(+), 86 deletions(-) diff --git a/src/main/target/AIR32/target.h b/src/main/target/AIR32/target.h index 5560a598d..1cf10c683 100644 --- a/src/main/target/AIR32/target.h +++ b/src/main/target/AIR32/target.h @@ -18,7 +18,6 @@ #pragma once #define TARGET_BOARD_IDENTIFIER "AR32" // AiR32 -#define USE_CLI #define CONFIG_FASTLOOP_PREFERRED_ACC ACC_DEFAULT @@ -87,7 +86,6 @@ #define M25P16_CS_PIN PB12 #define M25P16_SPI_INSTANCE SPI2 -#undef GPS #define USE_FLASHFS #define USE_FLASH_M25P16 diff --git a/src/main/target/AIRHEROF3/target.h b/src/main/target/AIRHEROF3/target.h index 9810a5945..c137a59e9 100755 --- a/src/main/target/AIRHEROF3/target.h +++ b/src/main/target/AIRHEROF3/target.h @@ -85,8 +85,6 @@ #define LED_STRIP -#define GPS - #define DEFAULT_FEATURES FEATURE_VBAT #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL #define SERIALRX_PROVIDER SERIALRX_SBUS diff --git a/src/main/target/ALIENFLIGHTF1/target.h b/src/main/target/ALIENFLIGHTF1/target.h index 098afa03f..1061f82d6 100644 --- a/src/main/target/ALIENFLIGHTF1/target.h +++ b/src/main/target/ALIENFLIGHTF1/target.h @@ -64,8 +64,6 @@ #define LED_STRIP -#undef GPS - #define SPEKTRUM_BIND // USART2, PA3 #define BIND_PIN PA3 diff --git a/src/main/target/CC3D/target.h b/src/main/target/CC3D/target.h index 7c638f767..1ed738d15 100644 --- a/src/main/target/CC3D/target.h +++ b/src/main/target/CC3D/target.h @@ -103,7 +103,6 @@ //#define SONAR_ECHO_PIN PB0 //#define SONAR_TRIGGER_PIN PB5 -#undef GPS #undef MAG #ifdef CC3D_OPBL diff --git a/src/main/target/FISHDRONEF4/target.h b/src/main/target/FISHDRONEF4/target.h index 4697c3f18..b6ee920e2 100644 --- a/src/main/target/FISHDRONEF4/target.h +++ b/src/main/target/FISHDRONEF4/target.h @@ -134,7 +134,6 @@ #define SERIALRX_UART SERIAL_PORT_USART3 // *************** Others ************************** -#define DISPLAY #define LED_STRIP #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT diff --git a/src/main/target/MICROSCISKY/target.h b/src/main/target/MICROSCISKY/target.h index 8b6cc28d9..d1d7fc693 100644 --- a/src/main/target/MICROSCISKY/target.h +++ b/src/main/target/MICROSCISKY/target.h @@ -82,7 +82,6 @@ #define SERIALRX_UART SERIAL_PORT_USART2 #define RX_CHANNELS_TAER -#undef GPS #undef USE_SERVOS #define USE_QUAD_MIXER_ONLY diff --git a/src/main/target/MOTOLAB/target.h b/src/main/target/MOTOLAB/target.h index f736df072..e7a75ddc2 100644 --- a/src/main/target/MOTOLAB/target.h +++ b/src/main/target/MOTOLAB/target.h @@ -18,7 +18,6 @@ #pragma once #define TARGET_BOARD_IDENTIFIER "MOTO" // MotoLab -#define USE_CLI #define CONFIG_FASTLOOP_PREFERRED_ACC ACC_DEFAULT #define TARGET_CONFIG @@ -87,7 +86,6 @@ #define M25P16_CS_PIN PB12 #define M25P16_SPI_INSTANCE SPI2 -#undef GPS #define USE_FLASHFS #define USE_FLASH_M25P16 diff --git a/src/main/target/NAZE/target.h b/src/main/target/NAZE/target.h index 2d77fc283..3040036bf 100644 --- a/src/main/target/NAZE/target.h +++ b/src/main/target/NAZE/target.h @@ -143,8 +143,6 @@ #define LED_STRIP -#undef GPS - #define SPEKTRUM_BIND // USART2, PA3 #define BIND_PIN PA3 diff --git a/src/main/target/OMNIBUS/target.h b/src/main/target/OMNIBUS/target.h index 4072ffea5..c6f157e30 100644 --- a/src/main/target/OMNIBUS/target.h +++ b/src/main/target/OMNIBUS/target.h @@ -58,8 +58,6 @@ //#define SONAR_ECHO_PIN PB1 //#define SONAR_TRIGGER_PIN PB0 -#undef GPS - #define USB_IO #define USB_CABLE_DETECTION #define USB_DETECT_PIN PB5 diff --git a/src/main/target/PIKOBLX/target.h b/src/main/target/PIKOBLX/target.h index 92235bc5c..2ddb46ae9 100644 --- a/src/main/target/PIKOBLX/target.h +++ b/src/main/target/PIKOBLX/target.h @@ -18,7 +18,6 @@ #pragma once #define TARGET_BOARD_IDENTIFIER "PIKO" // Furious FPV Piko BLX -#define USE_CLI #define CONFIG_FASTLOOP_PREFERRED_ACC ACC_DEFAULT #define TARGET_CONFIG @@ -71,11 +70,6 @@ #define USE_SPI #define USE_SPI_DEVICE_2 -#define TELEMETRY -#define BLACKBOX -#define SERIAL_RX -#define USE_SERVOS - #define BOARD_HAS_VOLTAGE_DIVIDER #define USE_ADC #define ADC_INSTANCE ADC2 diff --git a/src/main/target/RACEBASE/target.h b/src/main/target/RACEBASE/target.h index 3855d9c25..c1b9874ad 100755 --- a/src/main/target/RACEBASE/target.h +++ b/src/main/target/RACEBASE/target.h @@ -106,8 +106,6 @@ #define CONFIG_FASTLOOP_PREFERRED_ACC ACC_DEFAULT -#define USE_SERVOS - #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL #define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_VBAT | FEATURE_RSSI_ADC | FEATURE_OSD) diff --git a/src/main/target/RCEXPLORERF3/target.h b/src/main/target/RCEXPLORERF3/target.h index 3c226b2c8..991bc1cb1 100644 --- a/src/main/target/RCEXPLORERF3/target.h +++ b/src/main/target/RCEXPLORERF3/target.h @@ -114,13 +114,6 @@ #define NAV_AUTO_MAG_DECLINATION #define NAV_GPS_GLITCH_DETECTION #define NAV_MAX_WAYPOINTS 60 -#define GPS -#define BLACKBOX -#define TELEMETRY -#define SERIAL_RX -#define AUTOTUNE -#define USE_SERVOS -#define USE_CLI #define SPEKTRUM_BIND // USART3, diff --git a/src/main/target/REVONANO/target.h b/src/main/target/REVONANO/target.h index 2730382b2..7bc812e66 100644 --- a/src/main/target/REVONANO/target.h +++ b/src/main/target/REVONANO/target.h @@ -83,13 +83,6 @@ #define VBAT_ADC_PIN PA6 #define RSSI_ADC_PIN PA5 -#define GPS -#define BLACKBOX -#define TELEMETRY -#define SERIAL_RX -#define USE_SERVOS -#define USE_CLI - #define SPEKTRUM_BIND // USART2, PA3 #define BIND_PIN PA3 diff --git a/src/main/target/RG_SSD_F3/target.h b/src/main/target/RG_SSD_F3/target.h index 74f2b9ff8..752da3e31 100644 --- a/src/main/target/RG_SSD_F3/target.h +++ b/src/main/target/RG_SSD_F3/target.h @@ -138,12 +138,6 @@ #define TRANSPONDER_IRQ DMA1_Channel6_IRQn #define TRANSPONDER_DMA_TC_FLAG DMA1_FLAG_TC6 #define TRANSPONDER_DMA_HANDLER_IDENTIFER DMA1_CH6_HANDLER -#define BLACKBOX -#define GPS -#define SERIAL_RX -#define TELEMETRY -#define USE_SERVOS -#define USE_CLI #define DEFAULT_RX_FEATURE FEATURE_RX_PPM diff --git a/src/main/target/SIRINFPV/target.h b/src/main/target/SIRINFPV/target.h index 9fe7a93d9..b92e4e564 100644 --- a/src/main/target/SIRINFPV/target.h +++ b/src/main/target/SIRINFPV/target.h @@ -147,8 +147,6 @@ #define CONFIG_FASTLOOP_PREFERRED_ACC ACC_DEFAULT -#define USE_SERVOS - #define SPEKTRUM_BIND // USART3, PB11 #define BIND_PIN PB11 diff --git a/src/main/target/SPRACINGF3NEO/target.h b/src/main/target/SPRACINGF3NEO/target.h index f68ad3a4b..e1b77c3aa 100755 --- a/src/main/target/SPRACINGF3NEO/target.h +++ b/src/main/target/SPRACINGF3NEO/target.h @@ -159,8 +159,6 @@ #define OSD -#undef GPS - #define DEFAULT_RX_FEATURE FEATURE_RX_PPM #define DEFAULT_FEATURES (FEATURE_TRANSPONDER | FEATURE_BLACKBOX | FEATURE_RSSI_ADC | FEATURE_CURRENT_METER | FEATURE_TELEMETRY | FEATURE_OSD) diff --git a/src/main/target/common.h b/src/main/target/common.h index 5c1a538dc..ff6e964cb 100644 --- a/src/main/target/common.h +++ b/src/main/target/common.h @@ -31,47 +31,30 @@ #define I2C1_OVERCLOCK true #define I2C2_OVERCLOCK true -#ifdef STM32F7 -#define I2C3_OVERCLOCK true -#define I2C4_OVERCLOCK true -#define TELEMETRY_IBUS +#ifdef STM32F1 +#define MINIMAL_CLI +// Using RX DMA disables the use of receive callbacks +#define USE_UART1_RX_DMA +#define USE_UART1_TX_DMA +#endif + +#ifdef STM32F3 +#define MINIMAL_CLI +#define USE_DSHOT #endif -/**************************** - STM32 F4 specific settings. -****************************/ #ifdef STM32F4 #define USE_DSHOT #define I2C3_OVERCLOCK true #define TELEMETRY_IBUS #endif -#ifdef STM32F3 -#define USE_DSHOT -#undef GPS -#define MINIMAL_CLI +#ifdef STM32F7 +#define I2C3_OVERCLOCK true +#define I2C4_OVERCLOCK true +#define TELEMETRY_IBUS #endif -#ifdef STM32F1 -// Using RX DMA disables the use of receive callbacks -#define USE_UART1_RX_DMA -#define USE_UART1_TX_DMA - -#define MINIMAL_CLI -#endif - -#define SERIAL_RX -#define USE_SERIALRX_CRSF // Team Black Sheep Crossfire protocol -#define USE_SERIALRX_SPEKTRUM // SRXL, DSM2 and DSMX protocol -#define USE_SERIALRX_SBUS // Frsky and Futaba receivers -#define USE_SERIALRX_IBUS // FlySky and Turnigy receivers -#define USE_SERIALRX_SUMD // Graupner Hott protocol -#define USE_SERIALRX_SUMH // Graupner legacy protocol -#define USE_SERIALRX_XBUS // JR -#define USE_CLI -#define USE_PWM -#define USE_PPM - #if defined(STM32F4) || defined(STM32F7) #define TASK_GYROPID_DESIRED_PERIOD 125 #define SCHEDULER_DELAY_LIMIT 10 @@ -86,32 +69,44 @@ #define DEFAULT_AUX_CHANNEL_COUNT 6 #endif +#define USE_CLI +#define USE_PPM +#define USE_PWM +#define SERIAL_RX +#define USE_SERIALRX_CRSF // Team Black Sheep Crossfire protocol +#define USE_SERIALRX_IBUS // FlySky and Turnigy receivers +#define USE_SERIALRX_SBUS // Frsky and Futaba receivers +#define USE_SERIALRX_SPEKTRUM // SRXL, DSM2 and DSMX protocol +#define USE_SERIALRX_SUMD // Graupner Hott protocol +#define USE_SERIALRX_SUMH // Graupner legacy protocol +#define USE_SERIALRX_XBUS // JR + #if (FLASH_SIZE > 64) #define BLACKBOX -#define GPS #define TELEMETRY #define TELEMETRY_FRSKY #define TELEMETRY_HOTT #define TELEMETRY_LTM #define TELEMETRY_SMARTPORT -#define USE_SERVOS #define USE_RESOURCE_MGMT +#define USE_SERVOS #endif #if (FLASH_SIZE > 128) +#define GPS #define CMS -#define USE_DASHBOARD -#define USE_MSP_DISPLAYPORT #define TELEMETRY_CRSF -#define TELEMETRY_SRXL #define TELEMETRY_JETIEXBUS #define TELEMETRY_MAVLINK +#define TELEMETRY_SRXL +#define USE_DASHBOARD +#define USE_MSP_DISPLAYPORT #define USE_RX_MSP #define USE_SERIALRX_JETIEXBUS +#define USE_SENSOR_NAMES #define VTX_COMMON #define VTX_CONTROL #define VTX_SMARTAUDIO #define VTX_TRAMP -#define USE_SENSOR_NAMES #endif diff --git a/src/test/unit/platform.h b/src/test/unit/platform.h index 2179e912b..e3cbbab9e 100644 --- a/src/test/unit/platform.h +++ b/src/test/unit/platform.h @@ -26,7 +26,7 @@ #define MAG #define BARO #define GPS -#define DISPLAY +#define USE_DASHBOARD #define TELEMETRY #define LED_STRIP #define USE_SERVOS diff --git a/src/test/unit/target.h b/src/test/unit/target.h index e4d607342..efd1219dc 100644 --- a/src/test/unit/target.h +++ b/src/test/unit/target.h @@ -23,7 +23,7 @@ #define MAG #define BARO #define GPS -#define DISPLAY +#define USE_DASHBOARD #define SERIAL_RX #define USE_RX_MSP #define USE_SERIALRX_CRSF // Team Black Sheep Crossfire protocol