[gps] call gps_periodic_check from module

This commit is contained in:
Felix Ruess
2016-05-18 15:23:59 +02:00
parent 2374f82a98
commit 6cc4d590f5
18 changed files with 19 additions and 22 deletions
+1 -1
View File
@@ -14,7 +14,7 @@
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_nmea_init()"/>
<!--periodic fun="gps_periodic_check()" freq="1." autorun="TRUE"/-->
<periodic fun="gps_periodic_check(&gps_nmea.state)" freq="1." autorun="TRUE"/>
<event fun="gps_nmea_event()"/>
<makefile target="ap">
<configure name="FURUNO_GPS_PORT" default="$(GPS_PORT)" case="upper|lower"/>
+1 -1
View File
@@ -14,7 +14,7 @@
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_mtk_init()"/>
<!--periodic fun="gps_periodic_check()" freq="1." autorun="TRUE"/-->
<periodic fun="gps_periodic_check(&gps_mtk.state)" freq="1." autorun="TRUE"/>
<event fun="gps_mtk_event()"/>
<makefile target="ap">
<configure name="MTK_GPS_PORT" default="$(GPS_PORT)" case="upper|lower"/>
+1 -1
View File
@@ -14,7 +14,7 @@
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_nmea_init()"/>
<!--periodic fun="gps_periodic_check()" freq="1." autorun="TRUE"/-->
<periodic fun="gps_periodic_check(&gps_nmea.state)" freq="1." autorun="TRUE"/>
<event fun="gps_nmea_event()"/>
<makefile target="ap">
<configure name="NMEA_GPS_PORT" default="$(GPS_PORT)" case="upper|lower"/>
+1 -1
View File
@@ -12,7 +12,7 @@
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_nps_init()"/>
<!--periodic fun="gps_periodic_check()" freq="1." autorun="TRUE"/-->
<periodic fun="gps_periodic_check(&gps_nps)" freq="1." autorun="TRUE"/>
<makefile target="nps">
<file name="gps.c" dir="subsystems"/>
<file name="gps_sim_nps.c" dir="subsystems/gps"/>
+1 -2
View File
@@ -13,9 +13,8 @@
<header>
<file name="gps.h" dir="subsystems"/>
</header>
<!-- uncomment these when not called explicitly from main anymore -->
<init fun="gps_piksi_init()"/>
<!--periodic fun="gps_periodic_check()" freq="1." autorun="TRUE"/-->
<periodic fun="gps_periodic_check(&gps_piksi)" freq="1." autorun="TRUE"/>
<event fun="gps_piksi_event()"/>
<makefile target="ap">
<configure name="PIKSI_GPS_PORT" default="$(GPS_PORT)" case="upper|lower"/>
+1 -1
View File
@@ -11,7 +11,7 @@
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_sim_init()"/>
<!--periodic fun="gps_periodic_check()" freq="1." autorun="TRUE"/-->
<periodic fun="gps_periodic_check(&gps)" freq="1." autorun="TRUE"/>
<makefile target="sim">
<file name="gps.c" dir="subsystems"/>
<file name="gps_sim.c" dir="subsystems/gps"/>
-1
View File
@@ -12,7 +12,6 @@
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_sim_hitl_init()"/>
<!--periodic fun="gps_periodic_check()" freq="1." autorun="TRUE"/-->
<event fun="gps_sim_hitl_event()"/>
<makefile target="ap" firmware="rotorcraft">
<configure name="GPS_LED" default="none"/>
+1 -1
View File
@@ -14,7 +14,7 @@
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_sirf_init()"/>
<!--periodic fun="gps_periodic_check()" freq="1." autorun="TRUE"/-->
<periodic fun="gps_periodic_check(&gps_sirf.state)" freq="1." autorun="TRUE"/>
<event fun="gps_sirf_event()"/>
<makefile target="ap">
<configure name="SIRF_GPS_PORT" default="$(GPS_PORT)" case="upper|lower"/>
+1 -1
View File
@@ -14,7 +14,7 @@
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_skytraq_init()"/>
<!--periodic fun="gps_periodic_check()" freq="1." autorun="TRUE"/-->
<periodic fun="gps_periodic_check(&gps_skytraq.state)" freq="1." autorun="TRUE"/>
<event fun="gps_skytraq_event()"/>
<makefile target="ap">
<configure name="SKYTRAQ_GPS_PORT" default="$(GPS_PORT)" case="upper|lower"/>
+1 -2
View File
@@ -13,9 +13,8 @@
<header>
<file name="gps.h" dir="subsystems"/>
</header>
<!-- uncomment these when not called explicitly from main anymore -->
<init fun="gps_ubx_init()"/>
<!--periodic fun="gps_periodic_check()" freq="1." autorun="TRUE"/-->
<periodic fun="gps_periodic_check(&gps_ubx.state)" freq="1." autorun="TRUE"/>
<event fun="gps_ubx_event()"/>
<makefile target="ap">
<configure name="UBX_GPS_PORT" default="$(GPS_PORT)" case="upper|lower"/>
+1 -1
View File
@@ -13,7 +13,7 @@
<file name="gps.h" dir="subsystems"/>
</header>
<init fun="gps_udp_init()"/>
<!--periodic fun="gps_periodic_check()" freq="1." autorun="TRUE"/-->
<periodic fun="gps_periodic_check(&gps_udp)" freq="1." autorun="TRUE"/>
<makefile target="ap">
<configure name="GPS_LED" default="none"/>
@@ -638,10 +638,6 @@ void sensors_task(void)
update_ahrs_from_sim();
#endif
#if USE_GPS
gps_periodic_check();
#endif
//FIXME: temporary hack, remove me
#ifdef InsPeriodic
InsPeriodic();
-1
View File
@@ -340,7 +340,6 @@ STATIC_INLINE void failsafe_check(void)
#endif
#if USE_GPS
gps_periodic_check();
if (autopilot_mode == AP_MODE_NAV &&
autopilot_motors_on &&
#if NO_GPS_LOST_WITH_RC_VALID
+3 -3
View File
@@ -160,10 +160,10 @@ static void send_gps_sol(struct transport_tx *trans, struct link_device *dev)
}
#endif
void gps_periodic_check(void)
void gps_periodic_check(struct GpsState *gps_s)
{
if (sys_time.nb_sec - gps.last_msg_time > GPS_TIMEOUT) {
gps.fix = GPS_FIX_NONE;
if (sys_time.nb_sec - gps_s->last_msg_time > GPS_TIMEOUT) {
gps_s->fix = GPS_FIX_NONE;
}
}
+1 -1
View File
@@ -151,7 +151,7 @@ static inline bool gps_has_been_good(void)
/** Periodic GPS check.
* Marks GPS as lost when no GPS message was received for GPS_TIMEOUT seconds
*/
extern void gps_periodic_check(void);
extern void gps_periodic_check(struct GpsState *gps_s);
/**
* GPS Reset
+2
View File
@@ -36,6 +36,8 @@
#define PRIMARY_GPS GPS_PIKSI
#endif
extern struct GpsState gps_piksi;
extern void gps_piksi_event(void);
extern void gps_piksi_init(void);
+1
View File
@@ -7,6 +7,7 @@
#define PRIMARY_GPS GPS_SIM
#endif
extern struct GpsState gps_nps;
extern bool gps_has_fix;
extern void gps_feed_value();
+2
View File
@@ -37,6 +37,8 @@
unsigned char gps_udp_read_buffer[256];
struct FmsNetwork *gps_network = NULL;
struct GpsState gps_udp;
void gps_udp_init(void)
{
gps_udp.fix = GPS_FIX_NONE;