[gps] adapt vectornav ins to multi GPS support

This commit is contained in:
Gautier Hattenberger
2016-02-15 19:45:27 +01:00
parent 80b338ce02
commit fdb133051c
4 changed files with 35 additions and 3 deletions
@@ -18,6 +18,19 @@ VN_SRCS += subsystems/ins/ins_vectornav_wrapper.c
# #
VN_CFLAGS += -DUSE_GPS VN_CFLAGS += -DUSE_GPS
VN_SRCS += $(SRC_SUBSYSTEMS)/gps.c VN_SRCS += $(SRC_SUBSYSTEMS)/gps.c
ifdef SECONDARY_GPS
ifneq (,$(findstring $(SECONDARY_GPS), vectornav))
# this is the secondary GPS
VN_CFLAGS += -DGPS_SECONDARY_TYPE_H=\"subsystems/ins_vectornav_wrapper.h\"
VN_CFLAGS += -DSECONDARY_GPS=gps_ubx
else
VN_CFLAGS += -DGPS_TYPE_H=\"subsystems/ins/ins_vectornav_wrapper.h\"
VN_CFLAGS += -DPRIMARY_GPS=gps_ubx
endif
else
# plain old single GPS usage
VN_CFLAGS += -DGPS_TYPE_H=\"subsystems/ins/ins_vectornav_wrapper.h\"
endif
# #
+5 -1
View File
@@ -161,7 +161,11 @@
#ifndef GPS_MULTI_ID #ifndef GPS_MULTI_ID
#define GPS_MULTI_ID 12 #define GPS_MULTI_ID 12
#endif #endif
#ifndef GPS_VECTORNAV_ID
#define GPS_VECTORNAV_ID 13
#endif
/* /*
* IDs of IMU sensors (accel, gyro) * IDs of IMU sensors (accel, gyro)
*/ */
@@ -33,3 +33,14 @@ void ins_vectornav_register(void)
{ {
ins_register_impl(ins_vectornav_init); ins_register_impl(ins_vectornav_init);
} }
void gps_vectornav_init(void)
{
gps.nb_channels = 0;
}
void gps_vectornav_register(void)
{
gps_register_impl(gps_vectornav_init, NULL, GPS_VECTORNAV_ID);
}
@@ -37,8 +37,12 @@
#define InsEvent ins_vectornav_event #define InsEvent ins_vectornav_event
#define GpsEvent() {}
extern void ins_vectornav_register(void); extern void ins_vectornav_register(void);
#ifndef PRIMARY_GPS
#define PRIMARY_GPS gps_vectornav
#endif
extern void gps_vectornav_init(void);
extern void gps_vectornav_register(void);
#endif /* INS_VECTORNAV_WRAPPER_H */ #endif /* INS_VECTORNAV_WRAPPER_H */