mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-10 18:24:11 +01:00
Merge remote-tracking branch 'origin/kenz/diag_stack_split' into next
This commit is contained in:
commit
897b07da02
@ -38,9 +38,15 @@ OUTDIR := $(TOP)/build/$(TARGET)
|
|||||||
DEBUG ?= NO
|
DEBUG ?= NO
|
||||||
|
|
||||||
# Include objects that are just nice information to show
|
# Include objects that are just nice information to show
|
||||||
DIAGNOSTICS ?= NO
|
STACK_DIAGNOSTICS ?= NO
|
||||||
|
MIXERSTATUS_DIAGNOSTICS ?= NO
|
||||||
|
RATEDESIRED_DIAGNOSTICS ?= NO
|
||||||
|
I2C_WDG_STATS_DIAGNOSTICS ?= NO
|
||||||
DIAG_TASKS ?= 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
|
# Set to YES to build a FW version that will erase all flash memory
|
||||||
ERASE_FLASH ?= NO
|
ERASE_FLASH ?= NO
|
||||||
# Set to YES to use the Servo output pins for debugging via scope or logic analyser
|
# Set to YES to use the Servo output pins for debugging via scope or logic analyser
|
||||||
@ -485,11 +491,25 @@ ifeq ($(DEBUG),YES)
|
|||||||
CFLAGS += -DDEBUG
|
CFLAGS += -DDEBUG
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(DIAGNOSTICS),YES)
|
#The following Makefile command, ifneq (, $(filter) $(A), $(B) $(C)) is equivalent
|
||||||
CFLAGS += -DDIAGNOSTICS
|
# to the pseudocode `if(A== B || A==C)`
|
||||||
|
ifneq (,$(filter YES,$(STACK_DIAGNOSTICS) $(ALL_DIGNOSTICS)))
|
||||||
|
CFLAGS += -DSTACK_DIAGNOSTICS
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(DIAG_TASKS),YES)
|
ifneq (,$(filter YES,$(MIXERSTATUS_DIAGNOSTICS) $(ALL_DIGNOSTICS)))
|
||||||
|
CFLAGS += -DMIXERSTATUS_DIAGNOSTICS
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq (,$(filter YES,$(RATEDESIRED_DIAGNOSTICS) $(ALL_DIGNOSTICS)))
|
||||||
|
CFLAGS += -DRATEDESIRED_DIAGNOSTICS
|
||||||
|
endif
|
||||||
|
|
||||||
|
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
|
CFLAGS += -DDIAG_TASKS
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ int32_t ActuatorInitialize()
|
|||||||
// Primary output of this module
|
// Primary output of this module
|
||||||
ActuatorCommandInitialize();
|
ActuatorCommandInitialize();
|
||||||
|
|
||||||
#if defined(DIAGNOSTICS)
|
#if defined(MIXERSTATUS_DIAGNOSTICS)
|
||||||
// UAVO only used for inspecting the internal status of the mixer during debug
|
// UAVO only used for inspecting the internal status of the mixer during debug
|
||||||
MixerStatusInitialize();
|
MixerStatusInitialize();
|
||||||
#endif
|
#endif
|
||||||
@ -212,7 +212,7 @@ static void actuatorTask(void* parameters)
|
|||||||
ActuatorDesiredGet(&desired);
|
ActuatorDesiredGet(&desired);
|
||||||
ActuatorCommandGet(&command);
|
ActuatorCommandGet(&command);
|
||||||
|
|
||||||
#if defined(DIAGNOSTICS)
|
#if defined(MIXERSTATUS_DIAGNOSTICS)
|
||||||
MixerStatusGet(&mixerStatus);
|
MixerStatusGet(&mixerStatus);
|
||||||
#endif
|
#endif
|
||||||
int nMixers = 0;
|
int nMixers = 0;
|
||||||
@ -362,7 +362,7 @@ static void actuatorTask(void* parameters)
|
|||||||
// Update in case read only (eg. during servo configuration)
|
// Update in case read only (eg. during servo configuration)
|
||||||
ActuatorCommandGet(&command);
|
ActuatorCommandGet(&command);
|
||||||
|
|
||||||
#if defined(DIAGNOSTICS)
|
#if defined(MIXERSTATUS_DIAGNOSTICS)
|
||||||
MixerStatusSet(&mixerStatus);
|
MixerStatusSet(&mixerStatus);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ int32_t StabilizationInitialize()
|
|||||||
// Initialize variables
|
// Initialize variables
|
||||||
StabilizationSettingsInitialize();
|
StabilizationSettingsInitialize();
|
||||||
ActuatorDesiredInitialize();
|
ActuatorDesiredInitialize();
|
||||||
#if defined(DIAGNOSTICS)
|
#if defined(RATEDESIRED_DIAGNOSTICS)
|
||||||
RateDesiredInitialize();
|
RateDesiredInitialize();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -172,8 +172,7 @@ static void stabilizationTask(void* parameters)
|
|||||||
StabilizationDesiredGet(&stabDesired);
|
StabilizationDesiredGet(&stabDesired);
|
||||||
AttitudeActualGet(&attitudeActual);
|
AttitudeActualGet(&attitudeActual);
|
||||||
GyrosGet(&gyrosData);
|
GyrosGet(&gyrosData);
|
||||||
|
#if defined(RATEDESIRED_DIAGNOSTICS)
|
||||||
#if defined(DIAGNOSTICS)
|
|
||||||
RateDesiredGet(&rateDesired);
|
RateDesiredGet(&rateDesired);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -350,7 +349,7 @@ static void stabilizationTask(void* parameters)
|
|||||||
if (settings.VbarPiroComp == STABILIZATIONSETTINGS_VBARPIROCOMP_TRUE)
|
if (settings.VbarPiroComp == STABILIZATIONSETTINGS_VBARPIROCOMP_TRUE)
|
||||||
stabilization_virtual_flybar_pirocomp(gyro_filtered[2], dT);
|
stabilization_virtual_flybar_pirocomp(gyro_filtered[2], dT);
|
||||||
|
|
||||||
#if defined(DIAGNOSTICS)
|
#if defined(RATEDESIRED_DIAGNOSTICS)
|
||||||
RateDesiredSet(&rateDesired);
|
RateDesiredSet(&rateDesired);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ static void objectUpdatedCb(UAVObjEvent * ev);
|
|||||||
static void updateStats();
|
static void updateStats();
|
||||||
static void updateSystemAlarms();
|
static void updateSystemAlarms();
|
||||||
static void systemTask(void *parameters);
|
static void systemTask(void *parameters);
|
||||||
#if defined(DIAGNOSTICS)
|
#if defined(I2C_WDG_STATS_DIAGNOSTICS)
|
||||||
static void updateI2Cstats();
|
static void updateI2Cstats();
|
||||||
static void updateWDGstats();
|
static void updateWDGstats();
|
||||||
#endif
|
#endif
|
||||||
@ -118,7 +118,7 @@ int32_t SystemModInitialize(void)
|
|||||||
#if defined(DIAG_TASKS)
|
#if defined(DIAG_TASKS)
|
||||||
TaskInfoInitialize();
|
TaskInfoInitialize();
|
||||||
#endif
|
#endif
|
||||||
#if defined(DIAGNOSTICS)
|
#if defined(I2C_WDG_STATS_DIAGNOSTICS)
|
||||||
I2CStatsInitialize();
|
I2CStatsInitialize();
|
||||||
WatchdogStatusInitialize();
|
WatchdogStatusInitialize();
|
||||||
#endif
|
#endif
|
||||||
@ -168,7 +168,7 @@ static void systemTask(void *parameters)
|
|||||||
|
|
||||||
// Update the system alarms
|
// Update the system alarms
|
||||||
updateSystemAlarms();
|
updateSystemAlarms();
|
||||||
#if defined(DIAGNOSTICS)
|
#if defined(I2C_WDG_STATS_DIAGNOSTICS)
|
||||||
updateI2Cstats();
|
updateI2Cstats();
|
||||||
updateWDGstats();
|
updateWDGstats();
|
||||||
#endif
|
#endif
|
||||||
@ -301,7 +301,7 @@ static void objectUpdatedCb(UAVObjEvent * ev)
|
|||||||
/**
|
/**
|
||||||
* Called periodically to update the I2C statistics
|
* Called periodically to update the I2C statistics
|
||||||
*/
|
*/
|
||||||
#if defined(DIAGNOSTICS)
|
#if defined(I2C_WDG_STATS_DIAGNOSTICS)
|
||||||
static void updateI2Cstats()
|
static void updateI2Cstats()
|
||||||
{
|
{
|
||||||
#if defined(PIOS_INCLUDE_I2C)
|
#if defined(PIOS_INCLUDE_I2C)
|
||||||
|
@ -38,7 +38,14 @@ OUTDIR := $(TOP)/build/$(TARGET)
|
|||||||
DEBUG ?= NO
|
DEBUG ?= NO
|
||||||
|
|
||||||
# Include objects that are just nice information to show
|
# Include objects that are just nice information to show
|
||||||
DIAGNOSTICS ?= NO
|
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
|
# Set to YES to build a FW version that will erase all flash memory
|
||||||
ERASE_FLASH ?= NO
|
ERASE_FLASH ?= NO
|
||||||
@ -378,8 +385,24 @@ ifeq ($(DEBUG),YES)
|
|||||||
CFLAGS = -DDEBUG
|
CFLAGS = -DDEBUG
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(DIAGNOSTICS),YES)
|
ifneq (,$(filter YES,$(STACK_DIAGNOSTICS) $(ALL_DIGNOSTICS)))
|
||||||
CFLAGS = -DDIAGNOSTICS
|
CFLAGS += -DSTACK_DIAGNOSTICS
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq (,$(filter YES,$(MIXERSTATUS_DIAGNOSTICS) $(ALL_DIGNOSTICS)))
|
||||||
|
CFLAGS += -DMIXERSTATUS_DIAGNOSTICS
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq (,$(filter YES,$(RATEDESIRED_DIAGNOSTICS) $(ALL_DIGNOSTICS)))
|
||||||
|
CFLAGS += -DRATEDESIRED_DIAGNOSTICS
|
||||||
|
endif
|
||||||
|
|
||||||
|
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
|
endif
|
||||||
|
|
||||||
CFLAGS += -g$(DEBUGF)
|
CFLAGS += -g$(DEBUGF)
|
||||||
|
@ -76,7 +76,7 @@ NVIC value of 255. */
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Enable run time stats collection */
|
/* Enable run time stats collection */
|
||||||
#if defined(DIAGNOSTICS)
|
#if defined(STACK_DIAGNOSTICS)
|
||||||
#define configCHECK_FOR_STACK_OVERFLOW 2
|
#define configCHECK_FOR_STACK_OVERFLOW 2
|
||||||
|
|
||||||
#define configGENERATE_RUN_TIME_STATS 1
|
#define configGENERATE_RUN_TIME_STATS 1
|
||||||
|
@ -255,7 +255,10 @@ endif
|
|||||||
# common architecture-specific flags from the device-specific library makefile
|
# common architecture-specific flags from the device-specific library makefile
|
||||||
CFLAGS += $(ARCHFLAGS)
|
CFLAGS += $(ARCHFLAGS)
|
||||||
|
|
||||||
CFLAGS += -DDIAGNOSTICS
|
CFLAGS += -DSTACK_DIAGNOSTICS
|
||||||
|
CFLAGS += -DMIXERSTATUS_DIAGNOSTICS
|
||||||
|
CFLAGS += -DRATEDESIRED_DIAGNOSTICS
|
||||||
|
CFLAGS += -DI2C_WDG_STATS_DIAGNOSTICS
|
||||||
CFLAGS += -DDIAG_TASKS
|
CFLAGS += -DDIAG_TASKS
|
||||||
|
|
||||||
# This is not the best place for these. Really should abstract out
|
# This is not the best place for these. Really should abstract out
|
||||||
|
@ -256,7 +256,11 @@ endif
|
|||||||
CFLAGS += $(ARCHFLAGS)
|
CFLAGS += $(ARCHFLAGS)
|
||||||
|
|
||||||
CFLAGS += $(UAVOBJDEFINE)
|
CFLAGS += $(UAVOBJDEFINE)
|
||||||
CFLAGS += -DDIAGNOSTICS
|
|
||||||
|
CFLAGS += -DSTACK_DIAGNOSTICS
|
||||||
|
CFLAGS += -DMIXERSTATUS_DIAGNOSTICS
|
||||||
|
CFLAGS += -DRATEDESIRED_DIAGNOSTICS
|
||||||
|
CFLAGS += -DI2C_WDG_STATS_DIAGNOSTICS
|
||||||
CFLAGS += -DDIAG_TASKS
|
CFLAGS += -DDIAG_TASKS
|
||||||
|
|
||||||
# This is not the best place for these. Really should abstract out
|
# This is not the best place for these. Really should abstract out
|
||||||
|
Loading…
Reference in New Issue
Block a user