From 59da5055cd8e22ca9a74fe81450d31b5e4b685dc Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Sat, 18 Jun 2011 23:54:32 +0300 Subject: [PATCH] usart: make USART ports configurable from make command line For CopterControl the following make options are available: USE_TELEMETRY=[YES|NO|1|3] (default is YES, USART1) USE_GPS=[YES|NO|1|3] (default is NO, USART3) USE_SPEKTRUM=[YES|NO|1|3] (default is NO, USART3) USE_SBUS=[YES|NO|1] (default is NO, USART1 only) --- flight/CopterControl/Makefile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/flight/CopterControl/Makefile b/flight/CopterControl/Makefile index 294e80e5f..c0bfd28ae 100644 --- a/flight/CopterControl/Makefile +++ b/flight/CopterControl/Makefile @@ -382,18 +382,39 @@ endif ifeq ($(ERASE_FLASH), YES) CDEFS += -DERASE_FLASH endif + +ifneq ($(USE_TELEMETRY), NO) ifeq ($(USE_TELEMETRY), YES) CDEFS += -DUSE_TELEMETRY +else +CDEFS += -DUSE_TELEMETRY -DPIOS_PORT_TELEMETRY=$(USE_TELEMETRY) endif +endif + +ifneq ($(USE_GPS), NO) ifeq ($(USE_GPS), YES) CDEFS += -DUSE_GPS +else +CDEFS += -DUSE_GPS -DPIOS_PORT_GPS=$(USE_GPS) endif +endif + +ifneq ($(USE_SPEKTRUM), NO) ifeq ($(USE_SPEKTRUM), YES) CDEFS += -DUSE_SPEKTRUM +else +CDEFS += -DUSE_SPEKTRUM -DPIOS_PORT_SPEKTRUM=$(USE_SPEKTRUM) endif +endif + +ifneq ($(USE_SBUS), NO) ifeq ($(USE_SBUS), YES) CDEFS += -DUSE_SBUS +else +CDEFS += -DUSE_SBUS -DPIOS_PORT_SBUS=$(USE_SBUS) endif +endif + ifeq ($(USE_I2C), YES) CDEFS += -DUSE_I2C endif