mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-02 21:37:24 +08:00
[gps] call gps_periodic_check from module
This commit is contained in:
@@ -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"/>
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user