make -DGPS flag useful: if it exists it should work

This commit is contained in:
Christophe De Wagter
2010-08-27 19:55:08 +00:00
parent b0ce03bc73
commit 285ac5826f
3 changed files with 9 additions and 5 deletions
+1 -3
View File
@@ -162,14 +162,12 @@
<firmware name="fixedwing"> <firmware name="fixedwing">
<target name="ap" board="tiny_2.11"> <target name="ap" board="tiny_2.11">
<param name="FLASH_MODE" value="IAP" />
<define name="AGR_CLIMB" /> <define name="AGR_CLIMB" />
<define name="ALT_KALMAN" /> <define name="ALT_KALMAN" />
<define name="GENERIC" value="1" />
</target> </target>
<target name="sim" board="pc" /> <target name="sim" board="pc" />
<subsystem name="radio_control" type="ppm"/> <subsystem name="radio_control" type="ppm" />
<!-- Communication --> <!-- Communication -->
<subsystem name="telemetry" type="transparent"> <subsystem name="telemetry" type="transparent">
+6 -1
View File
@@ -27,7 +27,6 @@
* *
*/ */
#ifndef GPS_H #ifndef GPS_H
#define GPS_H #define GPS_H
@@ -120,6 +119,12 @@ extern struct svinfo gps_svinfos[GPS_NB_CHANNELS];
#define GpsToggleLed() {} #define GpsToggleLed() {}
#endif #endif
#ifdef GPS
#define GpsTimeoutError (cpu_time_sec - last_gps_msg_t > FAILSAFE_DELAY_WITHOUT_GPS)
#else
#define GpsTimeoutError 1
#endif
#define UseGpsPosNoSend(_callback) { \ #define UseGpsPosNoSend(_callback) { \
if (GpsFixValid()) { \ if (GpsFixValid()) { \
last_gps_msg_t = cpu_time_sec; \ last_gps_msg_t = cpu_time_sec; \
+2 -1
View File
@@ -193,6 +193,7 @@ float energy; // Fuel consumption (mAh)
bool_t gps_lost = FALSE; bool_t gps_lost = FALSE;
#define Min(x, y) (x < y ? x : y) #define Min(x, y) (x < y ? x : y)
#define Max(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 /** If aircraft is launched and is in autonomus mode, go into
PPRZ_MODE_GPS_OUT_OF_ORDER mode (Failsafe) if we lost the GPS */ PPRZ_MODE_GPS_OUT_OF_ORDER mode (Failsafe) if we lost the GPS */
if (launch) { 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) { if (pprz_mode == PPRZ_MODE_AUTO2 || pprz_mode == PPRZ_MODE_HOME) {
last_pprz_mode = pprz_mode; last_pprz_mode = pprz_mode;
pprz_mode = PPRZ_MODE_GPS_OUT_OF_ORDER; pprz_mode = PPRZ_MODE_GPS_OUT_OF_ORDER;