make telemetry a seperate subsystem for rotorcraft as well. This means you have to add the telemetry subsystem to your airframe file, you can choose xbee_api as well

This commit is contained in:
Felix Ruess
2011-01-18 21:05:56 +01:00
parent 8f2b5a8017
commit 60a873ac63
6 changed files with 49 additions and 22 deletions
+1
View File
@@ -16,6 +16,7 @@
<define name="GUIDANCE_H_USE_REF"/>
<subsystem name="radio_control" type="ppm"/>
<subsystem name="telemetry" type="transparent"/>
<subsystem name="actuators" type="mkk">
<configure name="MKK_I2C_SCL_TIME" value="150"/><!-- this is optional, 150 is default, e.g. use 50 for 8 motors-->
</subsystem>
+4 -20
View File
@@ -23,13 +23,6 @@
#
#
#
# Expected from board file or overriden as xml param :
#
# MODEM_PORT
# MODEM_BAUD
#
CFG_SHARED=$(PAPARAZZI_SRC)/conf/autopilot/subsystems/shared
CFG_ROTORCRAFT=$(PAPARAZZI_SRC)/conf/autopilot/subsystems/rotorcraft
@@ -92,20 +85,11 @@ endif
#
# Telemetry/Datalink
#
# include subsystems/rotorcraft/telemetry_transparent.makefile
# or
# include subsystems/rotorcraft/telemetry_xbee_api.makefile
#
ap.srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c
ap.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport
ap.CFLAGS += -DDOWNLINK_DEVICE=$(MODEM_PORT)
ap.srcs += $(SRC_FIRMWARE)/telemetry.c
ap.srcs += downlink.c
ap.srcs += pprz_transport.c
ap.CFLAGS += -DDATALINK=PPRZ
ap.CFLAGS += -DPPRZ_UART=$(MODEM_PORT)
ap.srcs += $(SRC_FIRMWARE)/datalink.c
ap.CFLAGS += -DUSE_$(MODEM_PORT) -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD)
ifeq ($(ARCH), lpc21)
ap.CFLAGS += -D$(MODEM_PORT)_VIC_SLOT=6
endif
ap.srcs += $(SRC_BOOZ)/booz2_commands.c
@@ -0,0 +1,18 @@
#
# Expected from board file or overriden as xml param :
#
# MODEM_PORT
# MODEM_BAUD
#
ap.CFLAGS += -DUSE_$(MODEM_PORT)
ap.CFLAGS += -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD)
ap.CFLAGS += -DDOWNLINK -DDOWNLINK_DEVICE=$(MODEM_PORT) -DPPRZ_UART=$(MODEM_PORT)
ap.CFLAGS += -DDOWNLINK_TRANSPORT=PprzTransport -DDATALINK=PPRZ
ap.srcs += downlink.c pprz_transport.c
ap.srcs += $(SRC_FIRMWARE)/datalink.c $(SRC_FIRMWARE)/telemetry.c
ifeq ($(ARCH), lpc21)
ap.CFLAGS += -D$(MODEM_PORT)_VIC_SLOT=6
endif
@@ -0,0 +1,19 @@
# XBee modems in API mode
#
# Expected from board file or overriden as xml param :
#
# MODEM_PORT
# MODEM_BAUD
#
ap.CFLAGS += -DUSE_$(MODEM_PORT)
ap.CFLAGS += -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD)
ap.CFLAGS += -DDOWNLINK -DDOWNLINK_DEVICE=$(MODEM_PORT) -DXBEE_UART=$(MODEM_PORT)
ap.CFLAGS += -DDOWNLINK_TRANSPORT=XBeeTransport -DDATALINK=XBEE
ap.srcs += downlink.c xbee.c
ap.srcs += $(SRC_FIRMWARE)/datalink.c $(SRC_FIRMWARE)/telemetry.c
ifeq ($(ARCH), lpc21)
ap.CFLAGS += -D$(MODEM_PORT)_VIC_SLOT=6
endif
+2 -2
View File
@@ -78,8 +78,8 @@ EXTERN void dl_parse_msg(void);
#elif DATALINK == XBEE
#define DatalinkEvent() { \
if (XbeeBuffer()) { \
ReadXbeeBuffer(); \
if (XBeeBuffer()) { \
ReadXBeeBuffer(); \
if (xbee_msg_received) { \
xbee_parse_payload(); \
xbee_msg_received = FALSE; \
+5
View File
@@ -32,6 +32,7 @@
#include "downlink.h"
#include "firmwares/rotorcraft/telemetry.h"
#include "datalink.h"
#include "xbee.h"
#include "booz2_commands.h"
#include "firmwares/rotorcraft/actuators.h"
@@ -100,6 +101,10 @@ STATIC_INLINE void main_init( void ) {
actuators_init();
radio_control_init();
#if DATALINK == XBEE
xbee_init();
#endif
booz2_analog_init();
baro_init();