From f6bf7ff1c5ce361b25f91dd54080dd2204a0074b Mon Sep 17 00:00:00 2001 From: Martin Budden Date: Sun, 22 May 2016 14:49:10 +0100 Subject: [PATCH] Added setting of default features from target.h file --- src/main/config/config.c | 13 +++++++------ src/main/target/CJMCU/target.h | 2 ++ src/main/target/COLIBRI_RACE/target.h | 2 ++ src/main/target/LUX_RACE/target.h | 2 ++ src/main/target/NAZE/target.h | 5 ++++- src/main/target/SPARKY/target.h | 3 +++ 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/main/config/config.c b/src/main/config/config.c index cda5c4b98..7147b79aa 100755 --- a/src/main/config/config.c +++ b/src/main/config/config.c @@ -72,6 +72,10 @@ #include "config/config_profile.h" #include "config/config_master.h" +#ifndef DEFAULT_RX_FEATURE +#define DEFAULT_RX_FEATURE FEATURE_RX_PARALLEL_PWM +#endif + #define BRUSHED_MOTORS_PWM_RATE 16000 #define BRUSHLESS_MOTORS_PWM_RATE 400 @@ -424,8 +428,9 @@ static void resetConf(void) masterConfig.mixerMode = MIXER_QUADX; featureClearAll(); persistentFlagClearAll(); -#if defined(CJMCU) || defined(SPARKY) || defined(COLIBRI_RACE) || defined(MOTOLAB) || defined(LUX_RACE) - featureSet(FEATURE_RX_PPM); + featureSet(DEFAULT_RX_FEATURE | FEATURE_FAILSAFE); +#ifdef DEFAULT_FEATURES + featureSet(DEFAULT_FEATURES); #endif #ifdef BOARD_HAS_VOLTAGE_DIVIDER @@ -434,8 +439,6 @@ static void resetConf(void) featureSet(FEATURE_VBAT); #endif - featureSet(FEATURE_FAILSAFE); - // global settings masterConfig.current_profile_index = 0; // default profile masterConfig.dcm_kp_acc = 2500; // 0.25 * 10000 @@ -605,8 +608,6 @@ static void resetConf(void) // alternative defaults settings for ALIENWIIF1 and ALIENWIIF3 targets #ifdef ALIENWII32 - featureSet(FEATURE_RX_SERIAL); - featureSet(FEATURE_MOTOR_STOP); #ifdef ALIENWIIF3 masterConfig.serialConfig.portConfigs[2].functionMask = FUNCTION_RX_SERIAL; masterConfig.batteryConfig.vbatscale = 20; diff --git a/src/main/target/CJMCU/target.h b/src/main/target/CJMCU/target.h index 5c8907dc4..566b03426 100644 --- a/src/main/target/CJMCU/target.h +++ b/src/main/target/CJMCU/target.h @@ -64,6 +64,8 @@ #define BIND_PORT GPIOA #define BIND_PIN Pin_3 +#define DEFAULT_RX_FEATURE FEATURE_RX_PPM + // Since the CJMCU PCB has holes for 4 motors in each corner we can save same flash space by disabling support for other mixers. #define USE_QUAD_MIXER_ONLY #undef USE_SERVOS diff --git a/src/main/target/COLIBRI_RACE/target.h b/src/main/target/COLIBRI_RACE/target.h index d24ddbaee..1c74fff15 100755 --- a/src/main/target/COLIBRI_RACE/target.h +++ b/src/main/target/COLIBRI_RACE/target.h @@ -162,3 +162,5 @@ #define USE_SERIAL_4WAY_BLHELI_INTERFACE +#define DEFAULT_RX_FEATURE FEATURE_RX_PPM + diff --git a/src/main/target/LUX_RACE/target.h b/src/main/target/LUX_RACE/target.h index 70e411c7d..ff41c8bfd 100644 --- a/src/main/target/LUX_RACE/target.h +++ b/src/main/target/LUX_RACE/target.h @@ -155,3 +155,5 @@ #undef GPS_PROTO_I2C_NAV #undef GPS_PROTO_NAZA +#define DEFAULT_RX_FEATURE FEATURE_RX_PPM + diff --git a/src/main/target/NAZE/target.h b/src/main/target/NAZE/target.h index bcf3dff32..3d57410bc 100644 --- a/src/main/target/NAZE/target.h +++ b/src/main/target/NAZE/target.h @@ -206,8 +206,11 @@ #undef TARGET_BOARD_IDENTIFIER #define TARGET_BOARD_IDENTIFIER "AWF1" // AlienWii32 F1. #undef BOARD_HAS_VOLTAGE_DIVIDER -#define HARDWARE_BIND_PLUG +#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL +#define DEFAULT_FEATURES FEATURE_MOTOR_STOP + +#define HARDWARE_BIND_PLUG // Hardware bind plug at PB5 (Pin 41) #define BINDPLUG_PORT GPIOB #define BINDPLUG_PIN Pin_5 diff --git a/src/main/target/SPARKY/target.h b/src/main/target/SPARKY/target.h index 08890e8d1..2f1c7ba20 100644 --- a/src/main/target/SPARKY/target.h +++ b/src/main/target/SPARKY/target.h @@ -163,3 +163,6 @@ // USART2, PA3 #define BIND_PORT GPIOA #define BIND_PIN Pin_3 + +#define DEFAULT_RX_FEATURE FEATURE_RX_PPM + -- 2.11.4.GIT