1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-15 07:29:15 +01:00

OP-1365 Flight code instrumentation API: Add CopterControl support

This commit is contained in:
Alessio Morale 2014-06-07 00:47:06 +02:00
parent e9364271d1
commit 9db264a457
4 changed files with 12 additions and 1 deletions

View File

@ -48,7 +48,7 @@ int8_t PIOS_Instrumentation_CreateCounter(uint32_t id)
{
PIOS_Assert(pios_instrumentation_perf_counters && (pios_instrumentation_max_counters > pios_instrumentation_last_used_counter));
int8_t idx = ++pios_instrumentation_last_used_counter;
pios_instrumentation_perf_counters[idx].id = id;
pios_instrumentation_perf_counters[idx].id = id;
pios_instrumentation_perf_counters[idx].max = INT32_MIN;
pios_instrumentation_perf_counters[idx].min = INT32_MAX;
return idx;

View File

@ -72,6 +72,7 @@ ifndef TESTAPP
SRC += $(OPSYSTEM)/coptercontrol.c
SRC += $(OPSYSTEM)/pios_board.c
SRC += $(FLIGHTLIB)/alarms.c
SRC += $(FLIGHTLIB)/instrumentation.c
SRC += $(OPUAVTALK)/uavtalk.c
SRC += $(OPUAVOBJ)/uavobjectmanager.c
SRC += $(OPUAVOBJ)/eventdispatcher.c
@ -126,6 +127,7 @@ ifndef TESTAPP
SRC += $(OPUAVSYNTHDIR)/txpidsettings.c
SRC += $(OPUAVSYNTHDIR)/airspeedstate.c
SRC += $(OPUAVSYNTHDIR)/mpu6000settings.c
SRC += $(OPUAVSYNTHDIR)/perfcounter.c
else
## Test Code
SRC += $(OPTESTS)/test_common.c

View File

@ -56,6 +56,8 @@
#define PIOS_INCLUDE_INITCALL
#define PIOS_INCLUDE_SYS
#define PIOS_INCLUDE_TASK_MONITOR
// #define PIOS_INCLUDE_INSTRUMENTATION
#define PIOS_INSTRUMENTATION_MAX_COUNTERS 3
/* PIOS hardware peripherals */
#define PIOS_INCLUDE_IRQ

View File

@ -33,6 +33,9 @@
#include <gcsreceiver.h>
#include <taskinfo.h>
#ifdef PIOS_INCLUDE_INSTRUMENTATION
#include <pios_instrumentation.h>
#endif
/*
* Pull in the board-specific static HW definitions.
* Including .c files is a bit ugly but this allows all of
@ -150,6 +153,10 @@ 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 defined(PIOS_INCLUDE_SPI)
/* Set up the SPI interface to the serial flash */