mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-21 20:04:09 +08:00
make -DGPS flag useful: if it exists it should work
This commit is contained in:
@@ -162,14 +162,12 @@
|
||||
|
||||
<firmware name="fixedwing">
|
||||
<target name="ap" board="tiny_2.11">
|
||||
<param name="FLASH_MODE" value="IAP" />
|
||||
<define name="AGR_CLIMB" />
|
||||
<define name="ALT_KALMAN" />
|
||||
<define name="GENERIC" value="1" />
|
||||
</target>
|
||||
<target name="sim" board="pc" />
|
||||
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
<subsystem name="radio_control" type="ppm" />
|
||||
|
||||
<!-- Communication -->
|
||||
<subsystem name="telemetry" type="transparent">
|
||||
|
||||
+6
-1
@@ -27,7 +27,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef GPS_H
|
||||
#define GPS_H
|
||||
|
||||
@@ -120,6 +119,12 @@ extern struct svinfo gps_svinfos[GPS_NB_CHANNELS];
|
||||
#define GpsToggleLed() {}
|
||||
#endif
|
||||
|
||||
#ifdef GPS
|
||||
#define GpsTimeoutError (cpu_time_sec - last_gps_msg_t > FAILSAFE_DELAY_WITHOUT_GPS)
|
||||
#else
|
||||
#define GpsTimeoutError 1
|
||||
#endif
|
||||
|
||||
#define UseGpsPosNoSend(_callback) { \
|
||||
if (GpsFixValid()) { \
|
||||
last_gps_msg_t = cpu_time_sec; \
|
||||
|
||||
@@ -193,6 +193,7 @@ float energy; // Fuel consumption (mAh)
|
||||
|
||||
bool_t gps_lost = FALSE;
|
||||
|
||||
|
||||
#define Min(x, y) (x < y ? x : y)
|
||||
#define Max(x, y) (x > y ? x : y)
|
||||
|
||||
@@ -346,7 +347,7 @@ static void navigation_task( void ) {
|
||||
/** If aircraft is launched and is in autonomus mode, go into
|
||||
PPRZ_MODE_GPS_OUT_OF_ORDER mode (Failsafe) if we lost the GPS */
|
||||
if (launch) {
|
||||
if (cpu_time_sec - last_gps_msg_t > FAILSAFE_DELAY_WITHOUT_GPS) {
|
||||
if (GpsTimeoutError) {
|
||||
if (pprz_mode == PPRZ_MODE_AUTO2 || pprz_mode == PPRZ_MODE_HOME) {
|
||||
last_pprz_mode = pprz_mode;
|
||||
pprz_mode = PPRZ_MODE_GPS_OUT_OF_ORDER;
|
||||
|
||||
Reference in New Issue
Block a user