1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-18 08:54:15 +01:00

Added global flag for enabling all diagnostic tools.

This commit is contained in:
Laura Sebesta 2012-09-27 18:51:12 +02:00
parent 929bf73504
commit 4923655cd3
4 changed files with 21 additions and 12 deletions

View File

@ -44,6 +44,8 @@ RATEDESIRED_DIAGNOSTICS ?= NO
I2C_WDG_STATS_DIAGNOSTICS ?= NO
DIAG_TASKS ?= NO
#Or just turn on all the above diagnostics. WARNING: This consumes massive amounts of memory.
ALL_DIGNOSTICS ?=NO
# Set to YES to build a FW version that will erase all flash memory
ERASE_FLASH ?= NO
@ -478,23 +480,25 @@ ifeq ($(DEBUG),YES)
CFLAGS += -DDEBUG
endif
ifeq ($(STACK_DIAGNOSTICS),YES)
#The following Makefile command, ifneq (, $(filter) $(A), $(B) $(C)) is equivalent
# to the pseudocode `if(A== B || A==C)`
ifneq (,$(filter YES,$(STACK_DIAGNOSTICS) $(ALL_DIGNOSTICS)))
CFLAGS += -DSTACK_DIAGNOSTICS
endif
ifeq ($(MIXERSTATUS_DIAGNOSTICS),YES)
ifneq (,$(filter YES,$(MIXERSTATUS_DIAGNOSTICS) $(ALL_DIGNOSTICS)))
CFLAGS += -DMIXERSTATUS_DIAGNOSTICS
endif
ifeq ($(RATEDESIRED_DIAGNOSTICS),YES)
ifneq (,$(filter YES,$(RATEDESIRED_DIAGNOSTICS) $(ALL_DIGNOSTICS)))
CFLAGS += -DRATEDESIRED_DIAGNOSTICS
endif
ifeq ($(I2C_WDG_STATS_DIAGNOSTICS),YES)
ifneq (,$(filter YES,$(I2C_WDG_STATS_DIAGNOSTICS) $(ALL_DIGNOSTICS)))
CFLAGS += -DI2C_WDG_STATS_DIAGNOSTICS
endif
ifeq ($(DIAG_TASKS),YES)
ifneq (,$(filter YES,$(DIAG_TASKS) $(ALL_DIGNOSTICS)))
CFLAGS += -DDIAG_TASKS
endif

View File

@ -42,6 +42,10 @@ STACK_DIAGNOSTICS ?= NO
MIXERSTATUS_DIAGNOSTICS ?= NO
RATEDESIRED_DIAGNOSTICS ?= NO
I2C_WDG_STATS_DIAGNOSTICS ?= NO
DIAG_TASKS ?= YES
#Or just turn on all the above diagnostics. WARNING: This consumes massive amounts of memory.
ALL_DIGNOSTICS ?=NO
# Set to YES to build a FW version that will erase all flash memory
ERASE_FLASH ?= NO
@ -381,22 +385,26 @@ ifeq ($(DEBUG),YES)
CFLAGS = -DDEBUG
endif
ifeq ($(STACK_DIAGNOSTICS),YES)
ifneq (,$(filter YES,$(STACK_DIAGNOSTICS) $(ALL_DIGNOSTICS)))
CFLAGS += -DSTACK_DIAGNOSTICS
endif
ifeq ($(MIXERSTATUS_DIAGNOSTICS),YES)
ifneq (,$(filter YES,$(MIXERSTATUS_DIAGNOSTICS) $(ALL_DIGNOSTICS)))
CFLAGS += -DMIXERSTATUS_DIAGNOSTICS
endif
ifeq ($(RATEDESIRED_DIAGNOSTICS),YES)
ifneq (,$(filter YES,$(RATEDESIRED_DIAGNOSTICS) $(ALL_DIGNOSTICS)))
CFLAGS += -DRATEDESIRED_DIAGNOSTICS
endif
ifeq ($(I2C_WDG_STATS_DIAGNOSTICS),YES)
ifneq (,$(filter YES,$(I2C_WDG_STATS_DIAGNOSTICS) $(ALL_DIGNOSTICS)))
CFLAGS += -DI2C_WDG_STATS_DIAGNOSTICS
endif
ifneq (,$(filter YES,$(DIAG_TASKS) $(ALL_DIGNOSTICS)))
CFLAGS += -DDIAG_TASKS
endif
CFLAGS += -g$(DEBUGF)
CFLAGS += -O$(OPT)
CFLAGS += -mcpu=$(MCU)

View File

@ -259,7 +259,6 @@ CFLAGS += -DSTACK_DIAGNOSTICS
CFLAGS += -DMIXERSTATUS_DIAGNOSTICS
CFLAGS += -DRATEDESIRED_DIAGNOSTICS
CFLAGS += -DI2C_WDG_STATS_DIAGNOSTICS
CFLAGS += -DDIAG_TASKS
# This is not the best place for these. Really should abstract out

View File

@ -255,8 +255,6 @@ CFLAGS += -DSTACK_DIAGNOSTICS
CFLAGS += -DMIXERSTATUS_DIAGNOSTICS
CFLAGS += -DRATEDESIRED_DIAGNOSTICS
CFLAGS += -DI2C_WDG_STATS_DIAGNOSTICS
CFLAGS += -DDIAG_TASKS
# This is not the best place for these. Really should abstract out