1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-18 08:54:15 +01:00

OP-97 flight/GPS: Few fixes

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2025 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
sambas 2010-10-28 13:50:34 +00:00 committed by sambas
parent e528cc306b
commit 365a2a121a
2 changed files with 12 additions and 7 deletions

View File

@ -104,9 +104,14 @@ static void gpsTask(void *parameters)
uint32_t timeNowMs;
//#define DISABLE_GPS_TRESHOLD
//#define ENABLE_GPS_ONESENTENCE
#ifdef DISABLE_GPS_TRESHOLD
PIOS_COM_SendStringNonBlocking(gpsPort,"$PMTK397,0*23\r\n");
#endif
#ifdef ENABLE_GPS_ONESENTENCE
PIOS_COM_SendStringNonBlocking(gpsPort,"$PGCMD,21,2*6C\r\n");
#endif
// Loop forever
while (1) {

View File

@ -400,7 +400,7 @@ static bool nmeaProcessGPZDA(GPSPositionData * GpsData, char *sentence)
char *tokens;
char *delimiter = ",*";
#ifdef NMEA_DEBUG_VZDA
#ifdef NMEA_DEBUG_ZDA
PIOS_COM_SendFormattedStringNonBlocking(COM_DEBUG_USART, "$%s\r\n", sentence);
#endif
@ -415,13 +415,13 @@ static bool nmeaProcessGPZDA(GPSPositionData * GpsData, char *sentence)
gpst.Hour = (int)hms / 10000;
tokens = strsep(&next, delimiter);
gpst.Day = (uint8_t) NMEA_real_to_float(next);
gpst.Day = atoi(tokens);
tokens = strsep(&next, delimiter);
gpst.Month = (uint8_t) NMEA_real_to_float(next);
gpst.Month = atoi(tokens);
tokens = strsep(&next, delimiter);
gpst.Year = (uint16_t) NMEA_real_to_float(next);
gpst.Year = atoi(tokens);
GPSTimeSet(&gpst);
@ -696,13 +696,13 @@ static bool nmeaProcessPGTOP(GPSPositionData * GpsData, char *sentence)
GpsData->Groundspeed /= 3.6;
tokens = strsep(&next, delimiter);
gpst.Day = (uint8_t) NMEA_real_to_float(next);
gpst.Day = atoi(tokens);
tokens = strsep(&next, delimiter);
gpst.Month = (uint8_t) NMEA_real_to_float(next);
gpst.Month = atoi(tokens);
tokens = strsep(&next, delimiter);
gpst.Year = (uint16_t) NMEA_real_to_float(next);
gpst.Year = atoi(tokens);
GPSTimeSet(&gpst);