Skip to content

Commit 69239b1

Browse files
Mike SmithMike Smith
Mike Smith
authored and
Mike Smith
committed
Changes to get PX2FMU building again after syncing to OP.
1 parent f9f01a2 commit 69239b1

File tree

7 files changed

+272
-239
lines changed

7 files changed

+272
-239
lines changed

flight/PX2FMU/Makefile

+17-21
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ FLASH_TOOL = OPENOCD
6565

6666
#MODULES = MAVLink PX2Attitude Altitude Stabilization GPS FlightPlan ManualControl Guidance
6767
MODULES = Telemetry PX2Attitude Actuator Stabilization ManualControl
68+
PYMODULES = FlightPlan
6869
#MODULES = PX2Test
6970

7071
# Paths
@@ -83,19 +84,17 @@ FLIGHTLIBINC = $(FLIGHTLIB)/inc
8384
PIOS = ../PiOS
8485
PIOSINC = $(PIOS)/inc
8586
PIOSSTM32F2XX = $(PIOS)/STM32F2xx
87+
PIOSSTM32F2XXINC = $(PIOSSTM32F2XX)/inc
8688
PIOSCOMMON = $(PIOS)/Common
8789
PIOSBOARDS = $(PIOS)/Boards
8890
APPLIBDIR = $(PIOSSTM32F2XX)/Libraries
8991
STMLIBDIR = $(APPLIBDIR)
9092
STMSPDDIR = $(STMLIBDIR)/STM32F2xx_StdPeriph_Driver
9193
STMUSBDIR = $(PIOSSTM32F2XX)
92-
STMUSBDEVDIR = $(STMLIBDIR)/STM32_USB_Device_Library
93-
STMUSBCOREDIR = $(STMLIBDIR)/STM32_USB_OTG_Driver
9494
STMSPDSRCDIR = $(STMSPDDIR)/src
9595
STMSPDINCDIR = $(STMSPDDIR)/inc
9696
STMUSBSRCDIR = $(STMUSBDEVDIR)/Core/src
9797
STMUSBINCDIR = $(STMUSBDEVDIR)/Core/inc
98-
STMUSBCONFDIR = $(PIOSSTM32F2XX)/inc
9998
CMSISDIR = $(STMLIBDIR)/CMSIS/Core/CM3
10099
DOSFSDIR = $(APPLIBDIR)/dosfs
101100
MSDDIR = $(APPLIBDIR)/msd
@@ -121,17 +120,19 @@ UAVOBJSYNTHDIR = $(OUTDIR)/../uavobject-synthetics/flight
121120
# List C source files here. (C dependencies are automatically generated.)
122121
# use file-extension c for "c-only"-files
123122

124-
MODNAMES = $(notdir ${MODULES})
123+
MODNAMES = $(notdir ${MODULES} ${PYMODULES})
125124

126125
ifndef TESTAPP
127126

128-
## PyMite files
127+
## PyMite files and modules
129128
SRC += $(OUTDIR)/pmlib_img.c
130129
SRC += $(OUTDIR)/pmlib_nat.c
131130
SRC += $(OUTDIR)/pmlibusr_img.c
132131
SRC += $(OUTDIR)/pmlibusr_nat.c
133-
SRC += $(wildcard ${PYMITEVM}/*.c)
134-
SRC += $(wildcard ${PYMITEPLAT}/*.c)
132+
PYSRC += $(wildcard ${PYMITEVM}/*.c)
133+
PYSRC += $(wildcard ${PYMITEPLAT}/*.c)
134+
PYSRC += ${foreach MOD, ${PYMODULES}, ${wildcard ${OPMODULEDIR}/${MOD}/*.c}}
135+
SRC += $(PYSRC)
135136

136137
## MODULES
137138
SRC += ${foreach MOD, ${MODULES}, ${wildcard ${OPMODULEDIR}/${MOD}/*.c}}
@@ -178,7 +179,7 @@ SRC += $(PIOSSTM32F2XX)/pios_ppm.c
178179
SRC += $(PIOSSTM32F2XX)/pios_debug.c
179180
SRC += $(PIOSSTM32F2XX)/pios_gpio.c
180181
SRC += $(PIOSSTM32F2XX)/pios_exti.c
181-
#SRC += $(PIOSSTM32F2XX)/pios_rtc.c
182+
182183
SRC += $(PIOSSTM32F2XX)/pios_wdg.c
183184

184185
## PIOS Hardware (Common)
@@ -192,6 +193,7 @@ SRC += $(PIOSCOMMON)/pios_l3g4200.c
192193
SRC += $(PIOSCOMMON)/pios_hmc5883.c
193194
SRC += $(PIOSCOMMON)/pios_i2c_esc.c
194195
SRC += $(PIOSCOMMON)/pios_iap.c
196+
SRC += $(PIOSCOMMON)/pios_rcvr.c
195197
SRC += $(PIOSCOMMON)/printf-stdarg.c
196198
SRC += $(PIOSCOMMON)/pios_crc.c
197199

@@ -229,7 +231,7 @@ SRC += $(STMSPDSRCDIR)/misc.c
229231
SRC += $(RTOSSRCDIR)/list.c
230232
SRC += $(RTOSSRCDIR)/queue.c
231233
SRC += $(RTOSSRCDIR)/tasks.c
232-
SRC += $(RTOSSRCDIR)/timers.c
234+
#SRC += $(RTOSSRCDIR)/timers.c
233235

234236
## RTOS Portable
235237
SRC += $(RTOSSRCDIR)/portable/GCC/ARM_CM3/port.c
@@ -278,25 +280,22 @@ EXTRAINCDIRS += $(OPUAVOBJINC)
278280
EXTRAINCDIRS += $(UAVOBJSYNTHDIR)
279281
EXTRAINCDIRS += $(PIOS)
280282
EXTRAINCDIRS += $(PIOSINC)
283+
EXTRAINCDIRS += $(PIOSSTM32F2XXINC)
281284
EXTRAINCDIRS += $(FLIGHTLIBINC)
282285
EXTRAINCDIRS += $(PIOSSTM32F2XX)
283286
EXTRAINCDIRS += $(PIOSCOMMON)
284287
EXTRAINCDIRS += $(PIOSBOARDS)
285288
EXTRAINCDIRS += $(STMSPDINCDIR)
286289
EXTRAINCDIRS += $(STMUSBINCDIR)
287-
EXTRAINCDIRS += $(STMUSBCONFDIR)
288-
EXTRAINCDIRS += $(STMUSBDEVDIR)/Core/inc
289-
EXTRAINCDIRS += $(STMUSBCOREDIR)/inc
290290
EXTRAINCDIRS += $(CMSISDIR)
291291
EXTRAINCDIRS += $(DOSFSDIR)
292292
EXTRAINCDIRS += $(MSDDIR)
293293
EXTRAINCDIRS += $(RTOSINCDIR)
294294
EXTRAINCDIRS += $(APPLIBDIR)
295295
EXTRAINCDIRS += $(RTOSSRCDIR)/portable/GCC/ARM_CM3
296-
#EXTRAINCDIRS += $(AHRSBOOTLOADERINC)
297296
EXTRAINCDIRS += $(PYMITEINC)
298297

299-
EXTRAINCDIRS += ${foreach MOD, ${MODULES}, $(OPMODULEDIR)/${MOD}/inc} ${OPMODULEDIR}/System/inc
298+
EXTRAINCDIRS += ${foreach MOD, ${MODULES} ${PYMODULES}, $(OPMODULEDIR)/${MOD}/inc} ${OPMODULEDIR}/System/inc
300299

301300

302301
# List any extra directories to look for library files here.
@@ -445,9 +444,7 @@ endif
445444

446445
# Define programs and commands.
447446
REMOVE = $(REMOVE_CMD) -f
448-
#PYTHON = python
449-
#SHELL = sh
450-
#COPY = cp
447+
PYTHON = python
451448

452449
# List of all source files.
453450
ALLSRC = $(ASRCARM) $(ASRC) $(SRCARM) $(SRC) $(CPPSRCARM) $(CPPSRC)
@@ -463,7 +460,7 @@ LSTFILES = $(addprefix $(OUTDIR)/, $(addsuffix .lst, $(ALLSRCBASE)))
463460
DEPFILES = $(addprefix $(OUTDIR)/dep/, $(addsuffix .o.d, $(ALLSRCBASE)))
464461

465462
# Default target.
466-
all: gencode gccversion build
463+
all: gccversion build
467464

468465
ifeq ($(LOADFORMAT),ihex)
469466
build: elf hex lss sym
@@ -482,6 +479,7 @@ endif
482479
# Generate intermediate code
483480
gencode: ${OUTDIR}/InitMods.c ${OUTDIR}/pmlib_img.c ${OUTDIR}/pmlib_nat.c ${OUTDIR}/pmlibusr_img.c ${OUTDIR}/pmlibusr_nat.c ${OUTDIR}/pmfeatures.h
484481

482+
$(PYSRC): gencode
485483
# Generate code for module initialization
486484
${OUTDIR}/InitMods.c: Makefile
487485
@echo $(MSG_MODINIT) $(call toprel, $@)
@@ -543,8 +541,6 @@ opfw: $(OUTDIR)/$(TARGET).opfw
543541

544542
# Display sizes of sections.
545543
$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
546-
.PHONY: size
547-
size: $(OUTDIR)/$(TARGET).elf_size
548544

549545
# Generate Doxygen documents
550546
docs:
@@ -598,5 +594,5 @@ else
598594
endif
599595

600596
# Listing of phony targets.
601-
.PHONY : all build clean clean_list program gencode install
597+
.PHONY : all build clean clean_list gencode install
602598

flight/PX2FMU/System/inc/pios_config.h

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#define PIOS_INCLUDE_IRQ
5151
#define PIOS_INCLUDE_LED
5252
#define PIOS_INCLUDE_PPM
53+
#define PIOS_INCLUDE_RCVR
5354
#define PIOS_INCLUDE_SPI
5455
#define PIOS_INCLUDE_SYS
5556
#define PIOS_INCLUDE_USART

0 commit comments

Comments
 (0)