diff --git a/conf/modules/gps_ublox.xml b/conf/modules/gps_ublox.xml
index 0ab7093e28..f8a23b40a9 100644
--- a/conf/modules/gps_ublox.xml
+++ b/conf/modules/gps_ublox.xml
@@ -18,17 +18,31 @@
+
+
-
-
-
+
+
+
+ ifdef SECONDARY_GPS
+ ifneq (,$(findstring $(SECONDARY_GPS), ublox))
+ # this is the secondary GPS
+ ap.CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/gps/gps_ubx.h\"
+ ap.CFLAGS += -DSECONDARY_GPS=gps_ubx
+ else
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_ubx.h\"
+ ap.CFLAGS += -DPRIMARY_GPS=gps_ubx
+ endif
+ else
+ # plain old single GPS usage
+ ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_ubx.h\"
+ endif