From 121dad121cb41a073786b6f240b352632724150a Mon Sep 17 00:00:00 2001 From: "rob@marotori.com" Date: Fri, 20 Sep 2013 15:25:20 +0000 Subject: [PATCH] Streamlines and cleaned up code. Simple compile option TARANIS_STICKS=YES --- src/Makefile | 15 ++------------- src/targets/sky9x/adc_driver.cpp | 9 ++++----- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/Makefile b/src/Makefile index 4414b6582..32df9543d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -746,21 +746,10 @@ ifeq ($(AUTOSOURCE), YES) CPPDEFS += -DAUTOSOURCE endif -ifeq ($(STICK_AIL_REV), YES) - CPPDEFS += -DSTICK_AIL_REV +ifeq ($(TARANIS_STICKS), YES) + CPPDEFS += -DTARANIS_STICKS endif -ifeq ($(STICK_ELE_REV), YES) - CPPDEFS += -DSTICK_ELE_REV -endif - -ifeq ($(STICK_RUD_REV), YES) - CPPDEFS += -DSTICK_RUD_REV -endif - -ifeq ($(STICK_THR_REV), YES) - CPPDEFS += -DSTICK_THR_REV -endif ifeq ($(DBLKEYS), YES) ifeq ($(PCB), $(filter $(PCB), 9XR 9XR128 9XR2561)) diff --git a/src/targets/sky9x/adc_driver.cpp b/src/targets/sky9x/adc_driver.cpp index 5a1bab9f0..1d09ef988 100644 --- a/src/targets/sky9x/adc_driver.cpp +++ b/src/targets/sky9x/adc_driver.cpp @@ -38,10 +38,8 @@ volatile uint16_t Analog_values[NUMBER_ANALOG]; -#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, 0, 0}; -#else -const char ana_direction[NUMBER_ANALOG] = {0, 0, 0, 0 ,0 ,0 ,0 , 0, 0}; +#if defined(TARANIS_STICKS) +const char ana_direction[NUMBER_ANALOG] = {1, 1, 0, 1 ,0 ,1 ,0, 0, 0}; #endif @@ -120,11 +118,12 @@ void adcRead() } // adc direction correct + #if defined(TARANIS_STICKS) uint32_t i ; for (i=0; i