diff --git a/flight/targets/boards/discoveryf4bare/firmware/Makefile b/flight/targets/boards/discoveryf4bare/firmware/Makefile index 7472d176a..608d2b6cf 100644 --- a/flight/targets/boards/discoveryf4bare/firmware/Makefile +++ b/flight/targets/boards/discoveryf4bare/firmware/Makefile @@ -75,12 +75,14 @@ ifndef TESTAPP SRC += $(OPUAVTALK)/uavtalk.c SRC += $(OPUAVOBJ)/uavobjectmanager.c SRC += $(OPUAVOBJ)/eventdispatcher.c + #ifeq ($(DEBUG), YES) SRC += $(OPSYSTEM)/dcc_stdio.c SRC += $(OPSYSTEM)/cm3_fault_handlers.c #endif ## Misc library functions + SRC += $(FLIGHTLIB)/instrumentation.c SRC += $(FLIGHTLIB)/paths.c SRC += $(FLIGHTLIB)/plans.c SRC += $(FLIGHTLIB)/WorldMagModel.c diff --git a/flight/targets/boards/discoveryf4bare/firmware/UAVObjects.inc b/flight/targets/boards/discoveryf4bare/firmware/UAVObjects.inc index 3905af42f..49867c39e 100644 --- a/flight/targets/boards/discoveryf4bare/firmware/UAVObjects.inc +++ b/flight/targets/boards/discoveryf4bare/firmware/UAVObjects.inc @@ -114,6 +114,7 @@ UAVOBJSRCFILENAMES += poilearnsettings UAVOBJSRCFILENAMES += mpu6000settings UAVOBJSRCFILENAMES += txpidsettings UAVOBJSRCFILENAMES += takeofflocation +UAVOBJSRCFILENAMES += perfcounter UAVOBJSRC = $(foreach UAVOBJSRCFILE,$(UAVOBJSRCFILENAMES),$(OPUAVSYNTHDIR)/$(UAVOBJSRCFILE).c ) UAVOBJDEFINE = $(foreach UAVOBJSRCFILE,$(UAVOBJSRCFILENAMES),-DUAVOBJ_INIT_$(UAVOBJSRCFILE) ) diff --git a/flight/targets/boards/discoveryf4bare/firmware/inc/pios_config.h b/flight/targets/boards/discoveryf4bare/firmware/inc/pios_config.h index 897ef36d9..a55d4cb09 100644 --- a/flight/targets/boards/discoveryf4bare/firmware/inc/pios_config.h +++ b/flight/targets/boards/discoveryf4bare/firmware/inc/pios_config.h @@ -56,6 +56,9 @@ #define PIOS_INCLUDE_SYS #define PIOS_INCLUDE_TASK_MONITOR +#define PIOS_INSTRUMENTATION_MAX_COUNTERS 10 +#define PIOS_INCLUDE_INSTRUMENTATION + /* PIOS hardware peripherals */ #define PIOS_INCLUDE_IRQ #define PIOS_INCLUDE_RTC diff --git a/flight/targets/boards/discoveryf4bare/firmware/pios_board.c b/flight/targets/boards/discoveryf4bare/firmware/pios_board.c index ee7159705..e0ef4c3e5 100644 --- a/flight/targets/boards/discoveryf4bare/firmware/pios_board.c +++ b/flight/targets/boards/discoveryf4bare/firmware/pios_board.c @@ -36,6 +36,11 @@ #include #include #include + +#ifdef PIOS_INCLUDE_INSTRUMENTATION +#include +#endif + /* * Pull in the board-specific static HW definitions. * Including .c files is a bit ugly but this allows all of @@ -340,6 +345,11 @@ void PIOS_Board_Init(void) PIOS_LED_Init(led_cfg); #endif /* PIOS_INCLUDE_LED */ +#ifdef PIOS_INCLUDE_INSTRUMENTATION + PIOS_Instrumentation_Init(PIOS_INSTRUMENTATION_MAX_COUNTERS); +#endif + + #if false /* Set up the SPI interface to the gyro/acelerometer */ if (PIOS_SPI_Init(&pios_spi_gyro_id, &pios_spi_gyro_cfg)) {