Skip to content

Commit

Permalink
Copilot fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
podhrmic committed May 7, 2017
1 parent db469dd commit 5b43f6e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
1 change: 0 additions & 1 deletion conf/firmwares/rotorcraft.makefile
Expand Up @@ -43,7 +43,6 @@ VPATH += $(PAPARAZZI_HOME)/var/share
## COMMON ROTORCRAFT ALL TARGETS (AP + NPS)
##

$(TARGET).CFLAGS += -DFIRMWARE=ROTORCRAFT
$(TARGET).CFLAGS += $(ROTORCRAFT_INC)
$(TARGET).CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG)
$(TARGET).CFLAGS += -DPERIPHERALS_AUTO_INIT
Expand Down
1 change: 0 additions & 1 deletion conf/firmwares/subsystems/fixedwing/autopilot.makefile
Expand Up @@ -25,7 +25,6 @@
##
## COMMON FIXEDWING ALL TARGETS (SIM + AP + FBW ...)
##
$(TARGET).CFLAGS += -DFIRMWARE=FIXEDWING

#
# Board config + Include paths
Expand Down
26 changes: 6 additions & 20 deletions conf/modules/copilot.xml
Expand Up @@ -36,26 +36,12 @@
<datalink message="MOVE_WP" fun="copilot_parse_move_wp_dl(buf)"/>
<makefile target="ap">
<file name="copilot_common.c"/>
<raw>
# attach the correct file based on firmware
RESULT=0

ifneq (,$(findstring ROTORCRAFT,$($(TARGET).CFLAGS)))
# Rotorcraft
RESULT=1
$(TARGET).srcs += $(SRC_MODULES)/mission/copilot_rotorcraft.c
endif

ifneq (,$(findstring FIXEDWING,$($(TARGET).CFLAGS)))
# Fixedwing
$(TARGET).srcs += $(SRC_MODULES)/mission/copilot_fixedwing.c
RESULT=1
endif

ifeq ($(RESULT), 0)
$(error Error: Copilot module can be compiled only in Fixeding or Rotorcraft firmware. Please check your firmware.)
endif
</raw>
</makefile>
<makefile target="ap" firmware="fixedwing">
<file name="copilot_fixedwing.c"/>
</makefile>
<makefile target="ap" firmware="rotorcraft">
<file name="copilot_rotorcraft.c"/>
</makefile>
</module>

0 comments on commit 5b43f6e

Please sign in to comment.