From 52f09e5d5547c5ae013fe096c95da1c51c0e8a7a Mon Sep 17 00:00:00 2001 From: peabody124 Date: Sun, 13 Feb 2011 17:43:44 +0000 Subject: [PATCH] Add compile time flag (USE_SPEKTRUM) to enable spektrum support until the dynamic switching is done. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2778 ebee16cc-31ac-478f-84a7-5cbb03baadba --- flight/CopterControl/Makefile | 6 ++++++ flight/CopterControl/System/inc/pios_config.h | 8 +++++++- flight/OpenPilot/Makefile | 6 ++++++ flight/OpenPilot/System/inc/pios_config.h | 7 ++++++- 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/flight/CopterControl/Makefile b/flight/CopterControl/Makefile index 7b990ab78..8cdab2eef 100644 --- a/flight/CopterControl/Makefile +++ b/flight/CopterControl/Makefile @@ -36,6 +36,8 @@ ENABLE_AUX_UART ?= NO # USE_BOOTLOADER ?= NO +USE_SPEKTRUM ?= NO + # Set to YES when using Code Sourcery toolchain CODE_SOURCERY ?= YES @@ -390,6 +392,10 @@ ifeq ($(USE_BOOTLOADER), YES) CDEFS += -DUSE_BOOTLOADER endif +ifeq ($(USE_SPEKTRUM), YES) +CDEFS += -DUSE_SPEKTRUM +endif + # Place project-specific -D and/or -U options for # Assembler with preprocessor here. diff --git a/flight/CopterControl/System/inc/pios_config.h b/flight/CopterControl/System/inc/pios_config.h index f67fbfedc..2b56315d9 100644 --- a/flight/CopterControl/System/inc/pios_config.h +++ b/flight/CopterControl/System/inc/pios_config.h @@ -41,10 +41,16 @@ #define PIOS_INCLUDE_I2C #define PIOS_INCLUDE_IRQ #define PIOS_INCLUDE_LED + +#if defined(USE_SPEKTRUM) +#define PIOS_INCLUDE_SPEKTRUM +#else #define PIOS_INCLUDE_GPS -//#define PIOS_INCLUDE_SPEKTRUM //#define PIOS_INCLUDE_PPM #define PIOS_INCLUDE_PWM +#endif + + #define PIOS_INCLUDE_SERVO #define PIOS_INCLUDE_SPI #define PIOS_INCLUDE_SYS diff --git a/flight/OpenPilot/Makefile b/flight/OpenPilot/Makefile index b7c7840bd..cae61fdc6 100644 --- a/flight/OpenPilot/Makefile +++ b/flight/OpenPilot/Makefile @@ -36,6 +36,8 @@ ENABLE_AUX_UART ?= NO # USE_BOOTLOADER ?= NO +USE_SPEKTRUM ?= NO + # Set to YES when using Code Sourcery toolchain CODE_SOURCERY ?= YES @@ -383,6 +385,10 @@ ifeq ($(USE_BOOTLOADER), YES) CDEFS += -DUSE_BOOTLOADER endif +ifeq ($(USE_SPEKTRUM), YES) +CDEFS += -DUSE_SPEKTRUM +endif + # Place project-specific -D and/or -U options for # Assembler with preprocessor here. diff --git a/flight/OpenPilot/System/inc/pios_config.h b/flight/OpenPilot/System/inc/pios_config.h index 3f59e8c59..e8d5e9b1b 100644 --- a/flight/OpenPilot/System/inc/pios_config.h +++ b/flight/OpenPilot/System/inc/pios_config.h @@ -41,9 +41,14 @@ #define PIOS_INCLUDE_I2C #define PIOS_INCLUDE_IRQ #define PIOS_INCLUDE_LED -//#define PIOS_INCLUDE_SPEKTRUM + +#if defined(USE_SPEKTRUM) +#define PIOS_INCLUDE_SPEKTRUM +#else //#define PIOS_INCLUDE_PPM #define PIOS_INCLUDE_PWM +#endif + #define PIOS_INCLUDE_SERVO #define PIOS_INCLUDE_SPI #define PIOS_INCLUDE_SYS