mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-18 08:54:15 +01:00
OP-97 flight/GPS: Few more fixes
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2028 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
b9f74a86c3
commit
3f62776253
@ -105,6 +105,7 @@ static void gpsTask(void *parameters)
|
||||
|
||||
//#define DISABLE_GPS_TRESHOLD
|
||||
//#define ENABLE_GPS_ONESENTENCE
|
||||
//#define ENABLE_DEFAULT_NMEA
|
||||
|
||||
#ifdef DISABLE_GPS_TRESHOLD
|
||||
PIOS_COM_SendStringNonBlocking(gpsPort,"$PMTK397,0*23\r\n");
|
||||
@ -112,6 +113,9 @@ static void gpsTask(void *parameters)
|
||||
#ifdef ENABLE_GPS_ONESENTENCE
|
||||
PIOS_COM_SendStringNonBlocking(gpsPort,"$PGCMD,21,2*6C\r\n");
|
||||
#endif
|
||||
#ifdef ENABLE_DEFAULT_NMEA
|
||||
PIOS_COM_SendStringNonBlocking(gpsPort,"$PGCMD,21,3*6D\r\n");
|
||||
#endif
|
||||
|
||||
// Loop forever
|
||||
while (1) {
|
||||
|
@ -620,11 +620,10 @@ static bool nmeaProcessPGTOP(GPSPositionData * GpsData, char *sentence)
|
||||
gpst.Hour = (int)hms / 10000;
|
||||
|
||||
// next field: latitude
|
||||
// get latitude [ddmm.mmmmm]
|
||||
// get latitude decimal degrees
|
||||
tokens = strsep(&next, delimiter);
|
||||
if (!NMEA_latlon_to_fixed_point(&GpsData->Latitude, tokens)) {
|
||||
return false;
|
||||
}
|
||||
GpsData->Latitude = NMEA_real_to_float(tokens)*1e7;
|
||||
|
||||
// next field: N/S indicator
|
||||
// correct latitude for N/S
|
||||
tokens = strsep(&next, delimiter);
|
||||
@ -632,11 +631,10 @@ static bool nmeaProcessPGTOP(GPSPositionData * GpsData, char *sentence)
|
||||
GpsData->Latitude = -GpsData->Latitude;
|
||||
|
||||
// next field: longitude
|
||||
// get longitude [dddmm.mmmmm]
|
||||
// get longitude decimal degrees
|
||||
tokens = strsep(&next, delimiter);
|
||||
if (!NMEA_latlon_to_fixed_point(&GpsData->Longitude, tokens)) {
|
||||
return false;
|
||||
}
|
||||
GpsData->Longitude = NMEA_real_to_float(tokens)*1e7;
|
||||
|
||||
// next field: E/W indicator
|
||||
// correct longitude for E/W
|
||||
tokens = strsep(&next, delimiter);
|
||||
|
Loading…
x
Reference in New Issue
Block a user