mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-06 21:54:15 +01:00
Merge branch 'master' into OP-383_Edouard_CPUSerial_in_FirmwareIAP
This commit is contained in:
commit
cdb6b65e64
@ -53,8 +53,11 @@
|
|||||||
// Private functions
|
// Private functions
|
||||||
|
|
||||||
static void gpsTask(void *parameters);
|
static void gpsTask(void *parameters);
|
||||||
|
|
||||||
|
#ifdef PIOS_GPS_SETS_HOMELOCATION
|
||||||
static void setHomeLocation(GPSPositionData * gpsData);
|
static void setHomeLocation(GPSPositionData * gpsData);
|
||||||
static float GravityAccel(float latitude, float longitude, float altitude);
|
static float GravityAccel(float latitude, float longitude, float altitude);
|
||||||
|
#endif
|
||||||
|
|
||||||
// ****************
|
// ****************
|
||||||
// Private constants
|
// Private constants
|
||||||
@ -65,11 +68,19 @@ static float GravityAccel(float latitude, float longitude, float altitude);
|
|||||||
#define GPS_TIMEOUT_MS 500
|
#define GPS_TIMEOUT_MS 500
|
||||||
#define GPS_COMMAND_RESEND_TIMEOUT_MS 2000
|
#define GPS_COMMAND_RESEND_TIMEOUT_MS 2000
|
||||||
|
|
||||||
|
#ifdef PIOS_GPS_SETS_HOMELOCATION
|
||||||
// Unfortunately need a good size stack for the WMM calculation
|
// Unfortunately need a good size stack for the WMM calculation
|
||||||
#ifdef ENABLE_GPS_BINARY_GTOP
|
#ifdef ENABLE_GPS_BINARY_GTOP
|
||||||
#define STACK_SIZE_BYTES 800
|
#define STACK_SIZE_BYTES 800
|
||||||
|
#else
|
||||||
|
#define STACK_SIZE_BYTES 800
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#define STACK_SIZE_BYTES 800
|
#ifdef ENABLE_GPS_BINARY_GTOP
|
||||||
|
#define STACK_SIZE_BYTES 440
|
||||||
|
#else
|
||||||
|
#define STACK_SIZE_BYTES 440
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TASK_PRIORITY (tskIDLE_PRIORITY + 1)
|
#define TASK_PRIORITY (tskIDLE_PRIORITY + 1)
|
||||||
@ -311,12 +322,14 @@ static void gpsTask(void *parameters)
|
|||||||
else
|
else
|
||||||
{ // we appear to be receiving GPS sentences OK, we've had an update
|
{ // we appear to be receiving GPS sentences OK, we've had an update
|
||||||
|
|
||||||
|
#ifdef PIOS_GPS_SETS_HOMELOCATION
|
||||||
HomeLocationData home;
|
HomeLocationData home;
|
||||||
HomeLocationGet(&home);
|
HomeLocationGet(&home);
|
||||||
|
|
||||||
GPSPositionGet(&GpsData);
|
GPSPositionGet(&GpsData);
|
||||||
if ((GpsData.Status == GPSPOSITION_STATUS_FIX3D) && (home.Set == HOMELOCATION_SET_FALSE))
|
if ((GpsData.Status == GPSPOSITION_STATUS_FIX3D) && (home.Set == HOMELOCATION_SET_FALSE))
|
||||||
setHomeLocation(&GpsData);
|
setHomeLocation(&GpsData);
|
||||||
|
#endif
|
||||||
|
|
||||||
//criteria for GPS-OK taken from this post...
|
//criteria for GPS-OK taken from this post...
|
||||||
//http://forums.openpilot.org/topic/1523-professors-insgps-in-svn/page__view__findpost__p__5220
|
//http://forums.openpilot.org/topic/1523-professors-insgps-in-svn/page__view__findpost__p__5220
|
||||||
@ -334,6 +347,7 @@ static void gpsTask(void *parameters)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PIOS_GPS_SETS_HOMELOCATION
|
||||||
/*
|
/*
|
||||||
* Estimate the acceleration due to gravity for a particular location in LLA
|
* Estimate the acceleration due to gravity for a particular location in LLA
|
||||||
*/
|
*/
|
||||||
@ -389,6 +403,7 @@ static void setHomeLocation(GPSPositionData * gpsData)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// ****************
|
// ****************
|
||||||
|
|
||||||
|
@ -90,6 +90,9 @@
|
|||||||
/* Stabilization options */
|
/* Stabilization options */
|
||||||
#define PIOS_QUATERNION_STABILIZATION
|
#define PIOS_QUATERNION_STABILIZATION
|
||||||
|
|
||||||
|
/* GPS options */
|
||||||
|
#define PIOS_GPS_SETS_HOMELOCATION
|
||||||
|
|
||||||
|
|
||||||
#endif /* PIOS_CONFIG_H */
|
#endif /* PIOS_CONFIG_H */
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user