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

Set PDOP and VDOP to 99.99 in binary mode (theose values are not available in binary mode). A couple of cleanups too.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2874 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
pip 2011-02-24 10:55:45 +00:00 committed by pip
parent 5f22a885ad
commit 4b4d9043fb
3 changed files with 15 additions and 9 deletions

View File

@ -265,7 +265,7 @@ static void gpsTask(void *parameters)
// Check for GPS timeout
timeNowMs = xTaskGetTickCount() * portTICK_RATE_MS;
if ((timeNowMs - timeOfLastUpdateMs) > GPS_TIMEOUT_MS)
if ((timeNowMs - timeOfLastUpdateMs) >= GPS_TIMEOUT_MS)
{ // we have not received any valid GPS sentences for a while.
// either the GPS is not plugged in or a hardware problem or the GPS has locked up.

View File

@ -33,6 +33,7 @@
#include "GTOP_BIN.h"
#include "gpsposition.h"
#include "gpstime.h"
#include "gpssatellites.h"
#include <string.h> // memmove
@ -119,7 +120,7 @@ static uint32_t swap4Bytes(uint32_t data)
int GTOP_BIN_update_position(uint8_t b, volatile uint32_t *chksum_errors, volatile uint32_t *parsing_errors)
{
if (gps_rx_buffer_wr >= sizeof(gps_rx_buffer))
{ // make room for the new byte
{ // make room for the new byte .. this will actually never get executed, just here as a safe guard really
memmove(gps_rx_buffer, gps_rx_buffer + 1, sizeof(gps_rx_buffer) - 1);
gps_rx_buffer_wr = sizeof(gps_rx_buffer) - 1;
}
@ -198,7 +199,7 @@ int GTOP_BIN_update_position(uint8_t b, volatile uint32_t *chksum_errors, volati
// set the gps time object
GPSTimeData GpsTime;
GPSTimeGet(&GpsTime);
// GPSTimeGet(&GpsTime);
uint32_t utc_time = rx_packet->data.utc_time / 1000;
GpsTime.Second = utc_time % 100; // seconds
GpsTime.Minute = (utc_time / 100) % 100; // minutes
@ -210,7 +211,7 @@ int GTOP_BIN_update_position(uint8_t b, volatile uint32_t *chksum_errors, volati
// set the gps position object
GPSPositionData GpsData;
GPSPositionGet(&GpsData);
// GPSPositionGet(&GpsData);
switch (rx_packet->data.fix_type)
{
case 1: GpsData.Status = GPSPOSITION_STATUS_NOFIX; break;
@ -225,11 +226,18 @@ int GTOP_BIN_update_position(uint8_t b, volatile uint32_t *chksum_errors, volati
GpsData.Heading = (float)rx_packet->data.course_over_ground / 1000; // degrees
GpsData.Groundspeed = (float)rx_packet->data.speed_over_ground / 3600; // m/s
GpsData.Satellites = rx_packet->data.satellites_used; //
// GpsData.PDOP; // not available in binary mode
GpsData.PDOP = 99.99; // not available in binary mode
GpsData.HDOP = (float)rx_packet->data.hdop / 100; //
// GpsData.VDOP; // not available in binary mode
GpsData.VDOP = 99.99; // not available in binary mode
GPSPositionSet(&GpsData);
// set the number of satellites
// GPSSatellitesData SattelliteData;
//// GPSSatellitesGet(&SattelliteData);
// memset(&SattelliteData, 0, sizeof(SattelliteData));
// SattelliteData.SatsInView = rx_packet->data.satellites_used; //
// GPSSatellitesSet(&SattelliteData);
// remove the spent binary packet from the buffer
gps_rx_buffer_wr -= sizeof(t_gps_bin_packet);
if (gps_rx_buffer_wr > 0)

View File

@ -33,9 +33,7 @@
#include "NMEA.h"
#include "gpsposition.h"
#include "gpstime.h"
#ifdef ENABLE_GPS_NMEA
#include "gpssatellites.h"
#endif
#include "gpssatellites.h"
#if defined(ENABLE_GPS_NMEA) || defined(ENABLE_GPS_ONESENTENCE_GTOP)