diff --git a/flight/OpenPilot/Makefile b/flight/OpenPilot/Makefile index 2153b686c..f2a95946a 100644 --- a/flight/OpenPilot/Makefile +++ b/flight/OpenPilot/Makefile @@ -37,6 +37,9 @@ OUTDIR := $(TOP)/build/$(TARGET) # Set to YES to compile for debugging DEBUG ?= YES +# Include objects that are just nice information to show +DIAGNOSTICS ?= YES + # Set to YES to use the Servo output pins for debugging via scope or logic analyser ENABLE_DEBUG_PINS ?= NO @@ -391,8 +394,9 @@ ifeq ($(DEBUG),YES) CFLAGS = -g$(DEBUGF) -DDEBUG endif -# OP has enough memory to always enable optional objects -CFLAGS += -DDIAGNOSTICS +ifeq ($(DIAGNOSTICS),YES) +CFLAGS = -DDIAGNOSTICS +endif CFLAGS += -O$(OPT) CFLAGS += -mcpu=$(MCU) diff --git a/flight/OpenPilot/Makefile.posix b/flight/OpenPilot/Makefile.posix index b1853b795..6ec62fd12 100644 --- a/flight/OpenPilot/Makefile.posix +++ b/flight/OpenPilot/Makefile.posix @@ -27,6 +27,9 @@ # Set to YES to compile for debugging DEBUG ?= YES +# Include objects that are just nice information to show +DIAGNOSTICS ?= YES + # Set to YES to use the Servo output pins for debugging via scope or logic analyser ENABLE_DEBUG_PINS ?= NO @@ -311,6 +314,10 @@ ifeq ($(DEBUG),YES) CFLAGS = -g$(DEBUGF) -DDEBUG endif +ifeq ($(DIAGNOSTICS),YES) +CFLAGS = -DDIAGNOSTICS +endif + CFLAGS += $(CFLAGS_UAVOBJECTS) CFLAGS += -DARCH_POSIX CFLAGS += -O$(OPT)