mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-05 06:54:49 +08:00
[gps] swapped GPS_SECONDARY for SECONDARY_GPS
This commit is contained in:
@@ -45,7 +45,7 @@ PRINT_CONFIG_VAR(SECONDARY_GPS)
|
|||||||
#define RegisterGps(_x) _RegisterGps(_x)
|
#define RegisterGps(_x) _RegisterGps(_x)
|
||||||
|
|
||||||
/** maximum number of GPS implementations that can register */
|
/** maximum number of GPS implementations that can register */
|
||||||
#if GPS_SECONDARY
|
#ifdef SECONDARY_GPS
|
||||||
#define GPS_NB_IMPL 2
|
#define GPS_NB_IMPL 2
|
||||||
#else
|
#else
|
||||||
#define GPS_NB_IMPL 1
|
#define GPS_NB_IMPL 1
|
||||||
@@ -69,7 +69,7 @@ struct GpsState gps;
|
|||||||
|
|
||||||
struct GpsTimeSync gps_time_sync;
|
struct GpsTimeSync gps_time_sync;
|
||||||
|
|
||||||
#if GPS_SECONDARY
|
#ifdef SECONDARY_GPS
|
||||||
static uint8_t current_gps_id = 0;
|
static uint8_t current_gps_id = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -183,7 +183,7 @@ void gps_periodic_check(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GPS_SECONDARY
|
#ifdef SECONDARY_GPS
|
||||||
static uint8_t gps_multi_switch(struct GpsState *gps_s) {
|
static uint8_t gps_multi_switch(struct GpsState *gps_s) {
|
||||||
static uint32_t time_since_last_gps_switch = 0;
|
static uint32_t time_since_last_gps_switch = 0;
|
||||||
|
|
||||||
@@ -210,7 +210,7 @@ static uint8_t gps_multi_switch(struct GpsState *gps_s) {
|
|||||||
}
|
}
|
||||||
return current_gps_id;
|
return current_gps_id;
|
||||||
}
|
}
|
||||||
#endif /*GPS_SECONDARY*/
|
#endif /*SECONDARY_GPS*/
|
||||||
|
|
||||||
static abi_event gps_ev;
|
static abi_event gps_ev;
|
||||||
static void gps_cb(uint8_t sender_id,
|
static void gps_cb(uint8_t sender_id,
|
||||||
@@ -221,7 +221,7 @@ static void gps_cb(uint8_t sender_id,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uint32_t now_ts = get_sys_time_usec();
|
uint32_t now_ts = get_sys_time_usec();
|
||||||
#ifdef GPS_SECONDARY
|
#ifdef SECONDARY_GPS
|
||||||
current_gps_id = gps_multi_switch(gps_s);
|
current_gps_id = gps_multi_switch(gps_s);
|
||||||
if (gps_s->comp_id == current_gps_id) {
|
if (gps_s->comp_id == current_gps_id) {
|
||||||
gps = *gps_s;
|
gps = *gps_s;
|
||||||
|
|||||||
Reference in New Issue
Block a user