mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-29 02:38:07 +08:00
make -DGPS flag useful: if it exists it should work
This commit is contained in:
@@ -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
@@ -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; \
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user