Skip to content

Commit

Permalink
Merge pull request #1625 from paparazzi/gps_modules
Browse files Browse the repository at this point in the history
convert GPS subsystems to modules
  • Loading branch information
gautierhattenberger committed Jun 17, 2016
2 parents 14144ed + 5a61011 commit a55e112
Show file tree
Hide file tree
Showing 69 changed files with 627 additions and 713 deletions.
8 changes: 0 additions & 8 deletions conf/firmwares/subsystems/fixedwing/gps_ublox_hitl.makefile

This file was deleted.

20 changes: 0 additions & 20 deletions conf/firmwares/subsystems/rotorcraft/gps_ardrone2.makefile

This file was deleted.

32 changes: 1 addition & 31 deletions conf/firmwares/subsystems/rotorcraft/gps_datalink.makefile
@@ -1,31 +1 @@
# Hey Emacs, this is a -*- makefile -*-

GPS_LED ?= none

ifneq ($(GPS_LED),none)
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
endif

ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), datalink))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_datalink.h\"
ap.CFLAGS += -DSECONDARY_GPS=gps_datalink
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_datalink.h\"
ap.CFLAGS += -DPRIMARY_GPS=gps_datalink
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_datalink.h\"
endif

ap.srcs += $(SRC_SUBSYSTEMS)/gps.c
ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_datalink.c

ap.CFLAGS += -DUSE_GPS -DGPS_DATALINK

nps.CFLAGS += -DUSE_GPS
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
$(error Error: The gps datalink subsystem has been converted to a module, replace <subsystem name="gps" type="datalink"/> by <module name="gps" type="datalink"/>)
3 changes: 0 additions & 3 deletions conf/firmwares/subsystems/rotorcraft/gps_optitrack.makefile

This file was deleted.

17 changes: 1 addition & 16 deletions conf/firmwares/subsystems/rotorcraft/gps_sim_hitl.makefile
@@ -1,16 +1 @@
# Hey Emacs, this is a -*- makefile -*-

ap.CFLAGS += -DUSE_GPS -DHITL
ap.CFLAGS += -DGPS_TYPE=\"subsystems/gps/gps_sim_hitl.h\"
ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_hitl.c

ap.srcs += $(SRC_SUBSYSTEMS)/gps.c

ifneq ($(GPS_LED),none)
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
endif

nps.CFLAGS += -DUSE_GPS
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
nps.CFLAGS += -DGPS_TYPE=\"subsystems/gps/gps_sim_nps.h\"
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
$(error Error: replace <subsystem name="gps" type="sim_hitl"/> by <module name="gps" type="sim_hitl"/>)
41 changes: 1 addition & 40 deletions conf/firmwares/subsystems/rotorcraft/gps_sirf.makefile
@@ -1,40 +1 @@
# Hey Emacs, this is a -*- makefile -*-

# Sirf GPS unit

GPS_LED ?= none
SIRF_GPS_PORT ?= $(GPS_PORT)
SIRF_GPS_BAUD ?= $(GPS_BAUD)

SIRF_GPS_PORT_LOWER=$(shell echo $(SIRF_GPS_PORT) | tr A-Z a-z)

ap.CFLAGS += -DUSE_GPS
ap.CFLAGS += -DSIRF_GPS_LINK=$(SIRF_GPS_PORT_LOWER)
ap.CFLAGS += -DUSE_$(SIRF_GPS_PORT)
ap.CFLAGS += -D$(SIRF_GPS_PORT)_BAUD=$(SIRF_GPS_BAUD)

ifneq ($(GPS_LED),none)
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
endif

ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), sirf))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_sirf.h\"
ap.CFLAGS += -DSECONDARY_GPS=gps_sirf
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sirf.h\"
ap.CFLAGS += -DPRIMARY_GPS=gps_sirf
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sirf.h\"
endif

ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sirf.c
ap.srcs += $(SRC_SUBSYSTEMS)/gps.c

nps.CFLAGS += -DUSE_GPS
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
$(error Error: The gps sirf subsystem has been converted to a module, replace <subsystem name="gps" type="sirf"/> by <module name="gps" type="sirf"/>)

This file was deleted.

31 changes: 1 addition & 30 deletions conf/firmwares/subsystems/rotorcraft/gps_udp.makefile
@@ -1,30 +1 @@
# Hey Emacs, this is a -*- makefile -*-

GPS_LED ?= none

ifneq ($(GPS_LED),none)
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
endif

ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), udp))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_udp.h\"
ap.CFLAGS += -DSECONDARY_GPS=gps_udp
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_udp.h\"
ap.CFLAGS += -DPRIMARY_GPS=gps_udp
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_udp.h\"
endif

ap.CFLAGS += -DUSE_GPS
ap.srcs += $(SRC_SUBSYSTEMS)/gps.c
ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_udp.c

nps.CFLAGS += -DUSE_GPS
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
$(error Error: The gps udp subsystem has been converted to a module, replace <subsystem name="gps" type="udp"/> by <module name="gps" type="udp"/>)
48 changes: 1 addition & 47 deletions conf/firmwares/subsystems/shared/gps_furuno.makefile
@@ -1,47 +1 @@
# Hey Emacs, this is a -*- makefile -*-

# Furuno NMEA GPS unit

GPS_LED ?= none
FURUNO_GPS_PORT ?= $(GPS_PORT)
FURUNO_GPS_BAUD ?= $(GPS_BAUD)

FURUNO_GPS_PORT_LOWER=$(shell echo $(FURUNO_GPS_PORT) | tr A-Z a-z)

ap.CFLAGS += -DUSE_GPS
ap.CFLAGS += -DNMEA_GPS_LINK=$(FURUNO_GPS_PORT_LOWER)
ap.CFLAGS += -DUSE_$(FURUNO_GPS_PORT)
ap.CFLAGS += -D$(FURUNO_GPS_PORT)_BAUD=$(FURUNO_GPS_BAUD)
ap.CFLAGS += -DNMEA_PARSE_PROP

ifneq ($(GPS_LED),none)
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
endif

ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), nmea furuno))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_nmea.h\"
ap.CFLAGS += -DSECONDARY_GPS=gps_nmea
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_nmea.h\"
ap.CFLAGS += -DPRIMARY_GPS=gps_nmea
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_nmea.h\"
endif

ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_nmea.c $(SRC_SUBSYSTEMS)/gps/gps_furuno.c
ap.srcs += $(SRC_SUBSYSTEMS)/gps.c

sim.CFLAGS += -DUSE_GPS
sim.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
sim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
sim.srcs += $(SRC_SUBSYSTEMS)/gps.c

nps.CFLAGS += -DUSE_GPS
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
$(error Error: The gps furuno subsystem has been converted to a module, replace <subsystem name="gps" type="furuno"/> by <module name="gps" type="furuno"/>)
46 changes: 1 addition & 45 deletions conf/firmwares/subsystems/shared/gps_mediatek_diy.makefile
@@ -1,45 +1 @@
# Hey Emacs, this is a -*- makefile -*-

# Mediatek MT3329, DIYDrones V1.4/1.6 protocol

GPS_LED ?= none
MTK_GPS_PORT ?= $(GPS_PORT)
MTK_GPS_BAUD ?= $(GPS_BAUD)

MTK_GPS_PORT_LOWER=$(shell echo $(MTK_GPS_PORT) | tr A-Z a-z)

ap.CFLAGS += -DUSE_GPS -DGPS_CONFIGURE
ap.CFLAGS += -DMTK_GPS_LINK=$(MTK_GPS_PORT_LOWER)
ap.CFLAGS += -DUSE_$(MTK_GPS_PORT)
ap.CFLAGS += -D$(MTK_GPS_PORT)_BAUD=$(MTK_GPS_BAUD)

ifneq ($(GPS_LED),none)
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
endif

ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), mtk mediatek))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_mtk.h\"
ap.CFLAGS += -DSECONDARY_GPS=gps_mtk
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_mtk.h\"
ap.CFLAGS += -DPRIMARY_GPS=gps_mtk
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_mtk.h\"
endif

ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_mtk.c
ap.srcs += $(SRC_SUBSYSTEMS)/gps.c

sim.CFLAGS += -DUSE_GPS
sim.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
sim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
sim.srcs += $(SRC_SUBSYSTEMS)/gps.c

nps.CFLAGS += -DUSE_GPS
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
$(error Error: The gps mediatek subsystem has been converted to a module, replace <subsystem name="gps" type="mediatek_diy"/> by <module name="gps" type="mediatek_diy"/>)
46 changes: 1 addition & 45 deletions conf/firmwares/subsystems/shared/gps_nmea.makefile
@@ -1,45 +1 @@
# Hey Emacs, this is a -*- makefile -*-

# NMEA GPS unit

GPS_LED ?= none
NMEA_GPS_PORT ?= $(GPS_PORT)
NMEA_GPS_BAUD ?= $(GPS_BAUD)

NMEA_GPS_PORT_LOWER=$(shell echo $(NMEA_GPS_PORT) | tr A-Z a-z)

ap.CFLAGS += -DUSE_GPS
ap.CFLAGS += -DNMEA_GPS_LINK=$(NMEA_GPS_PORT_LOWER)
ap.CFLAGS += -DUSE_$(NMEA_GPS_PORT)
ap.CFLAGS += -D$(NMEA_GPS_PORT)_BAUD=$(NMEA_GPS_BAUD)

ifneq ($(GPS_LED),none)
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
endif

ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), nmea))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_nmea.h\"
ap.CFLAGS += -DSECONDARY_GPS=gps_nmea
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_nmea.h\"
ap.CFLAGS += -DPRIMARY_GPS=gps_nmea
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_nmea.h\"
endif

ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_nmea.c
ap.srcs += $(SRC_SUBSYSTEMS)/gps.c

sim.CFLAGS += -DUSE_GPS
sim.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
sim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
sim.srcs += $(SRC_SUBSYSTEMS)/gps.c

nps.CFLAGS += -DUSE_GPS
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
$(error Error: The gps nmea subsystem has been converted to a module, replace <subsystem name="gps" type="nmea"/> with <module name="gps" type="nmea"/>)
49 changes: 1 addition & 48 deletions conf/firmwares/subsystems/shared/gps_piksi.makefile
@@ -1,48 +1 @@
# Hey Emacs, this is a -*- makefile -*-

# Swift-Nav Piksi RTK module

GPS_LED ?= none
PIKSI_GPS_PORT ?= $(GPS_PORT)
PIKSI_GPS_BAUD ?= $(GPS_BAUD)

PIKSI_GPS_PORT_LOWER=$(shell echo $(PIKSI_GPS_PORT) | tr A-Z a-z)

ap.CFLAGS += -DUSE_GPS
ap.CFLAGS += -DUSE_$(PIKSI_GPS_PORT) -D$(PIKSI_GPS_PORT)_BAUD=B115200
ap.CFLAGS += -DPIKSI_GPS_LINK=$(PIKSI_GPS_PORT_LOWER)

ifneq ($(GPS_LED),none)
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
endif

ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), piksi))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_piksi.h\"
ap.CFLAGS += -DSECONDARY_GPS=gps_piksi
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_piksi.h\"
ap.CFLAGS += -DPRIMARY_GPS=gps_piksi
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_piksi.h\"
endif

ap.srcs += $(SRC_SUBSYSTEMS)/gps.c
ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_piksi.c

# libsbp
ap.CFLAGS += -I$(PAPARAZZI_SRC)/sw/ext/libsbp/c/include
ap.srcs += $(PAPARAZZI_SRC)/sw/ext/libsbp/c/src/sbp.c $(PAPARAZZI_SRC)/sw/ext/libsbp/c/src/edc.c

sim.CFLAGS += -DUSE_GPS
sim.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
sim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
sim.srcs += $(SRC_SUBSYSTEMS)/gps.c

nps.CFLAGS += -DUSE_GPS
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
$(error Error: The gps piksi subsystem has been converted to a module, replace <subsystem name="gps" type="piksi"/> by <module name="gps" type="piksi"/>)
44 changes: 1 addition & 43 deletions conf/firmwares/subsystems/shared/gps_skytraq.makefile
@@ -1,43 +1 @@
# Hey Emacs, this is a -*- makefile -*-

GPS_LED ?= none
SKYTRAQ_GPS_PORT ?= $(GPS_PORT)
SKYTRAQ_GPS_BAUD ?= $(GPS_BAUD)

SKYTRAQ_GPS_PORT_LOWER=$(shell echo $(SKYTRAQ_GPS_PORT) | tr A-Z a-z)

ap.CFLAGS += -DUSE_GPS
ap.CFLAGS += -DSKYTRAQ_GPS_LINK=$(SKYTRAQ_SKYTRAQ_GPS_PORT_LOWER)
ap.CFLAGS += -DUSE_$(SKYTRAQ_GPS_PORT)
ap.CFLAGS += -D$(SKYTRAQ_GPS_PORT)_BAUD=$(SKYTRAQ_GPS_BAUD)

ifneq ($(GPS_LED),none)
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
endif

ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), skytraq))
# this is the secondary GPS
ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_skytraq.h\"
ap.CFLAGS += -DSECONDARY_GPS=gps_skytraq
else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_skytraq.h\"
ap.CFLAGS += -DPRIMARY_GPS=gps_skytraq
endif
else
# plain old single GPS usage
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_skytraq.h\"
endif

ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_skytraq.c
ap.srcs += $(SRC_SUBSYSTEMS)/gps.c

sim.CFLAGS += -DUSE_GPS
sim.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\"
sim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim.c
sim.srcs += $(SRC_SUBSYSTEMS)/gps.c

nps.CFLAGS += -DUSE_GPS
nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\"
nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c
nps.srcs += $(SRC_SUBSYSTEMS)/gps.c
$(error Error: The gps skytraq subsystem has been converted to a module, replace <subsystem name="gps" type="skytraq"/> by <module name="gps" type="skytraq"/>)

0 comments on commit a55e112

Please sign in to comment.