From 05e46242b02bf803640f73636837228c6950bd38 Mon Sep 17 00:00:00 2001 From: "rob@marotori.com" Date: Fri, 20 Sep 2013 14:50:03 +0000 Subject: [PATCH] Update to simplfy code a bit, and bypass changes if not compiled in. still to resolve: targets/sky9x/adc_driver.cpp:42:61: warning: character constant too long for its type [enabled by default] --- src/targets/sky9x/adc_driver.cpp | 6 +++++- src/targets/sky9x/board_sky9x.h | 25 ------------------------- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/src/targets/sky9x/adc_driver.cpp b/src/targets/sky9x/adc_driver.cpp index 6cc07ecb2..b41143e7c 100644 --- a/src/targets/sky9x/adc_driver.cpp +++ b/src/targets/sky9x/adc_driver.cpp @@ -37,8 +37,12 @@ #include "../opentx.h" volatile uint16_t Analog_values[NUMBER_ANALOG]; -const char ana_direction[NUMBER_ANALOG] = {'STICK_AIL_DIR', 'STICK_RUD_DIR', 0, 'STICK_ELE_DIR' ,0 , 'STICK_THR_DIR',0}; +#if defined(STICK_RUD_REV) || defined(STICK_AIL_REV) || defined(STICK_ELE_REV) || defined(STICK_THR_REV) +const char ana_direction[NUMBER_ANALOG] = {'STICK_AIL_REV', 'STICK_RUD_REV', 0, 'STICK_ELE_REV' ,0 , 'STICK_THR_REV',0}; +#else +const char ana_direction[NUMBER_ANALOG] = {0, 0, 0, 0 ,0 ,0 ,0}; +#endif // Settings for mode register ADC_MR diff --git a/src/targets/sky9x/board_sky9x.h b/src/targets/sky9x/board_sky9x.h index 39236d71a..af210a19b 100644 --- a/src/targets/sky9x/board_sky9x.h +++ b/src/targets/sky9x/board_sky9x.h @@ -174,31 +174,6 @@ void disable_ssc(); #define init_dsm2(port) init_main_ppm(5000, 0); init_ssc() #define disable_dsm2(port) disable_ssc() -// Stick Directions -#if defined(STICK_AIL_REV) - #define STICK_AIL_DIR = 1; -#else - #define STICK_AIL_DIR = 0; -#endif - -#if defined(STICK_ELE_REV) - #define STICK_ELE_DIR = 1; -#else - #define STICK_ELE_DIR = 0; -#endif - -#if defined(STICK_RUD_REV) - #define STICK_RUD_DIR = 1; -#else - #define STICK_RUD_DIR = 0; -#endif - -#if defined(STICK_THR_REV) - #define STICK_THR_DIR = 1; -#else - #define STICK_THR_DIR = 0; -#endif - // SD driver #if defined(SIMU)