[xsens] added new gps support

This commit is contained in:
masierra
2016-02-04 10:59:51 -08:00
parent f0266ad5b2
commit d90af7eb62
5 changed files with 48 additions and 6 deletions
@@ -41,7 +41,7 @@ ap.CFLAGS += -DUSE_GPS_XSENS
ap.CFLAGS += -DUSE_GPS_XSENS_RAW_DATA
ap.CFLAGS += -DGPS_NB_CHANNELS=16
ap.CFLAGS += -DUSE_GPS
ap.CFLAGS += -DGPS_TYPE_H=\"modules/ins/ins_xsens.h\"
ap.CFLAGS += -DPRIMARY_GPS_TYPE_H=\"modules/ins/ins_xsens.h\"
ap.srcs += $(SRC_SUBSYSTEMS)/gps.c
@@ -35,7 +35,7 @@ ap.CFLAGS += -DAHRS_TRIGGERED_ATTITUDE_LOOP
ap.CFLAGS += -DUSE_GPS_XSENS
ap.CFLAGS += -DGPS_NB_CHANNELS=50
ap.CFLAGS += -DUSE_GPS
ap.CFLAGS += -DGPS_TYPE_H=\"modules/ins/ins_xsens.h\"
ap.CFLAGS += -DPRIMARY_GPS_TYPE_H=\"modules/ins/ins_xsens.h\"
ap.srcs += $(SRC_SUBSYSTEMS)/gps.c
+20 -2
View File
@@ -299,7 +299,7 @@ void ins_xsens_update_gps(struct GpsState *gps_s)
#endif
#if USE_GPS_XSENS
void gps_impl_init(void)
void xsens_gps_impl_init(void)
{
gps.nb_channels = 0;
}
@@ -316,6 +316,11 @@ static void gps_xsens_publish(void)
}
AbiSendMsgGPS(GPS_XSENS_ID, now_ts, &gps);
}
void xsens_gps_event(void)
{
}
#endif
void xsens_periodic(void)
@@ -722,7 +727,6 @@ void parse_ins_msg(void)
}
void parse_ins_buffer(uint8_t c)
{
ck += c;
@@ -775,3 +779,17 @@ restart:
xsens_status = UNINIT;
return;
}
#ifdef USE_GPS_XSENS
/*
* register callbacks & structs
*/
void xsens_gps_register(void)
{
#ifdef GPS_SECONDARY_XSENS
gps_register_impl(xsens_gps_impl_init, xsens_gps_event, GPS_XSENS_ID, 1);
#else
gps_register_impl(xsens_gps_impl_init, xsens_gps_event, GPS_XSENS_ID, 0);
#endif
}
#endif
+6 -1
View File
@@ -79,7 +79,12 @@ extern void ins_xsens_register(void);
#if USE_GPS_XSENS
#define GpsEvent() {}
#ifndef PrimaryGpsImpl
#define PrimaryGpsImpl xsens
#endif
extern void xsens_gps_event(void);
extern void xsens_gps_impl_init(void);
extern void xsens_gps_register(void);
#endif
#endif
+20 -1
View File
@@ -230,7 +230,7 @@ void ins_xsens_update_gps(struct GpsState *gps_s)
#endif
#if USE_GPS_XSENS
void gps_impl_init(void)
void xsens_gps_impl_init(void)
{
gps.nb_channels = 0;
}
@@ -247,6 +247,11 @@ static void gps_xsens_publish(void)
}
AbiSendMsgGPS(GPS_XSENS_ID, now_ts, &gps);
}
void xsens_gps_event(void)
{
}
#endif
static void xsens_ask_message_rate(uint8_t c1, uint8_t c2, uint8_t freq)
@@ -623,3 +628,17 @@ restart:
xsens_status = UNINIT;
return;
}
#ifdef USE_GPS_XSENS
/*
* register callbacks & structs
*/
void xsens_gps_register(void)
{
#ifdef GPS_SECONDARY_XSENS
gps_register_impl(xsens_gps_impl_init, xsens_gps_event, GPS_XSENS_ID, 1);
#else
gps_register_impl(xsens_gps_impl_init, xsens_gps_event, GPS_XSENS_ID, 0);
#endif
}
#endif