1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-02 10:24:11 +01:00

OP-25 Flight/GPS: New GPS fields in use

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@665 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
sambas 2010-05-25 05:32:43 +00:00 committed by sambas
parent f7f1b37c62
commit ebff9f3638

View File

@ -145,6 +145,8 @@ char nmeaChecksum(char* gps_buffer)
{ {
char checksum=0; char checksum=0;
char checksum_received=0; char checksum_received=0;
GpsObjectData GpsData;
GpsObjectGet(&GpsData);
for(int x=0; x<NMEA_BUFFERSIZE; x++) for(int x=0; x<NMEA_BUFFERSIZE; x++)
{ {
@ -163,14 +165,14 @@ char nmeaChecksum(char* gps_buffer)
//PIOS_COM_SendFormattedStringNonBlocking(COM_DEBUG_USART,"$%d=%d\r\n",checksum_received,checksum); //PIOS_COM_SendFormattedStringNonBlocking(COM_DEBUG_USART,"$%d=%d\r\n",checksum_received,checksum);
if(checksum == checksum_received) if(checksum == checksum_received)
{ {
GpsObjectData GpsData;
GpsObjectGet(&GpsData);
GpsData.Updates++; GpsData.Updates++;
GpsObjectSet(&GpsData); GpsObjectSet(&GpsData);
return 1; return 1;
} }
else else
{ {
GpsData.Failures++;
GpsObjectSet(&GpsData);
return 0; return 0;
} }
} }
@ -640,17 +642,17 @@ void nmeaProcessGPGSA(char* packet)
tokens = strsep(&packet, delimiter); tokens = strsep(&packet, delimiter);
value=strtol (tokens,&pEnd,10); value=strtol (tokens,&pEnd,10);
desim=strtol (pEnd+1,NULL,10); desim=strtol (pEnd+1,NULL,10);
//GpsData.PDOP=value+desim/100.0; GpsData.PDOP=value+desim/100.0;
// next field: HDOP // next field: HDOP
tokens = strsep(&packet, delimiter); tokens = strsep(&packet, delimiter);
value=strtol (tokens,&pEnd,10); value=strtol (tokens,&pEnd,10);
desim=strtol (pEnd+1,NULL,10); desim=strtol (pEnd+1,NULL,10);
//GpsData.HDOP=value+desim/100.0; GpsData.HDOP=value+desim/100.0;
// next field: VDOP // next field: VDOP
tokens = strsep(&packet, delimiter); tokens = strsep(&packet, delimiter);
value=strtol (tokens,&pEnd,10); value=strtol (tokens,&pEnd,10);
desim=strtol (pEnd+1,NULL,10); desim=strtol (pEnd+1,NULL,10);
//GpsData.VDOP=value+desim/100.0; GpsData.VDOP=value+desim/100.0;
// next field: checksum // next field: checksum
GpsObjectSet(&GpsData); GpsObjectSet(&GpsData);