mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-04 05:42:49 +08:00
[gps] adapt vectornav ins to multi GPS support
This commit is contained in:
@@ -18,6 +18,19 @@ VN_SRCS += subsystems/ins/ins_vectornav_wrapper.c
|
||||
#
|
||||
VN_CFLAGS += -DUSE_GPS
|
||||
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
|
||||
|
||||
|
||||
#
|
||||
|
||||
@@ -161,7 +161,11 @@
|
||||
#ifndef GPS_MULTI_ID
|
||||
#define GPS_MULTI_ID 12
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef GPS_VECTORNAV_ID
|
||||
#define GPS_VECTORNAV_ID 13
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IDs of IMU sensors (accel, gyro)
|
||||
*/
|
||||
|
||||
@@ -33,3 +33,14 @@ void ins_vectornav_register(void)
|
||||
{
|
||||
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 GpsEvent() {}
|
||||
|
||||
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 */
|
||||
|
||||
Reference in New Issue
Block a user