diff --git a/sw/airborne/booz/booz_gps.c b/sw/airborne/booz/booz_gps.c index 74816fbdb0..dba5ad4517 100644 --- a/sw/airborne/booz/booz_gps.c +++ b/sw/airborne/booz/booz_gps.c @@ -41,8 +41,9 @@ void booz_gps_init(void) { #ifdef GPS_LED LED_OFF(GPS_LED); #endif +#ifdef BOOZ_GPS_TYPE_H booz_gps_impl_init(); - +#endif } diff --git a/sw/airborne/booz/booz_gps.h b/sw/airborne/booz/booz_gps.h index 844ca4f3fa..3a0203c07c 100644 --- a/sw/airborne/booz/booz_gps.h +++ b/sw/airborne/booz/booz_gps.h @@ -94,7 +94,7 @@ static inline void booz_gps_feed_value() { #define BoozGpsEvent(_sol_available_callback) { \ if (booz_gps_available) { \ if (booz_gps_state.fix == BOOZ2_GPS_FIX_3D) \ - booz_gps_lost_counter = 0; \ + booz_gps_state.lost_counter = 0; \ _sol_available_callback(); \ booz_gps_available = FALSE; \ } \ @@ -106,15 +106,6 @@ static inline void booz_gps_feed_value() { */ -extern void booz_gps_init(void); - -static inline void booz_gps_periodic( void ) { - RunOnceEvery(128, booz_gps_state.lost_counter++; ); -} - -#define GpsIsLost() (booz_gps_state.lost_counter > 20) /* 4Hz -> 5s */ - - #define __GpsLink(dev, _x) dev##_x #define _GpsLink(dev, _x) __GpsLink(dev, _x) #define GpsLink(_x) _GpsLink(GPS_LINK, _x) @@ -126,4 +117,16 @@ static inline void booz_gps_periodic( void ) { #endif /* !SITL */ + +extern void booz_gps_init(void); + +static inline void booz_gps_periodic( void ) { + RunOnceEvery(128, booz_gps_state.lost_counter++; ); +} + +#define GpsIsLost() (booz_gps_state.lost_counter > 20) /* 4Hz -> 5s */ + + + + #endif /* BOOZ2_GPS_H */