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

Refactor GPS_PURISTIC into GPS_MINIMAL

This commit is contained in:
Corvus Corax 2011-08-25 15:44:49 +02:00
parent 3690586f3a
commit 8173c7b7c6
3 changed files with 12 additions and 12 deletions

View File

@ -54,7 +54,7 @@
/* Supported USART-based PIOS modules */
#define PIOS_INCLUDE_TELEMETRY_RF
#define PIOS_INCLUDE_GPS
#define PIOS_GPS_PURISTIC
#define PIOS_GPS_MINIMAL
#define PIOS_INCLUDE_SERVO
#define PIOS_INCLUDE_SPI

View File

@ -109,7 +109,7 @@ int32_t GPSStart(void)
int32_t GPSInitialize(void)
{
GPSPositionInitialize();
#if !defined(PIOS_GPS_PURISTIC)
#if !defined(PIOS_GPS_MINIMAL)
GPSTimeInitialize();
GPSSatellitesInitialize();
#endif

View File

@ -70,10 +70,10 @@ static bool nmeaProcessGPGGA(GPSPositionData * GpsData, bool* gpsDataUpdated, ch
static bool nmeaProcessGPRMC(GPSPositionData * GpsData, bool* gpsDataUpdated, char* param[], uint8_t nbParam);
static bool nmeaProcessGPVTG(GPSPositionData * GpsData, bool* gpsDataUpdated, char* param[], uint8_t nbParam);
static bool nmeaProcessGPGSA(GPSPositionData * GpsData, bool* gpsDataUpdated, char* param[], uint8_t nbParam);
#if !defined(PIOS_GPS_PURISTIC)
#if !defined(PIOS_GPS_MINIMAL)
static bool nmeaProcessGPZDA(GPSPositionData * GpsData, bool* gpsDataUpdated, char* param[], uint8_t nbParam);
static bool nmeaProcessGPGSV(GPSPositionData * GpsData, bool* gpsDataUpdated, char* param[], uint8_t nbParam);
#endif //PIOS_GPS_PURISTIC
#endif //PIOS_GPS_MINIMAL
static struct nmea_parser nmea_parsers[] = {
@ -97,7 +97,7 @@ static struct nmea_parser nmea_parsers[] = {
.handler = nmeaProcessGPRMC,
.cnt = 0,
},
#if !defined(PIOS_GPS_PURISTIC)
#if !defined(PIOS_GPS_MINIMAL)
{
.prefix = "GPZDA",
.handler = nmeaProcessGPZDA,
@ -108,7 +108,7 @@ static struct nmea_parser nmea_parsers[] = {
.handler = nmeaProcessGPGSV,
.cnt = 0,
},
#endif //PIOS_GPS_PURISTIC
#endif //PIOS_GPS_MINIMAL
};
static struct nmea_parser *NMEA_find_parser_by_prefix(const char *prefix)
@ -432,7 +432,7 @@ static bool nmeaProcessGPRMC(GPSPositionData * GpsData, bool* gpsDataUpdated, ch
*gpsDataUpdated = true;
#if !defined(PIOS_GPS_PURISTIC)
#if !defined(PIOS_GPS_MINIMAL)
GPSTimeData gpst;
GPSTimeGet(&gpst);
@ -441,7 +441,7 @@ static bool nmeaProcessGPRMC(GPSPositionData * GpsData, bool* gpsDataUpdated, ch
gpst.Second = (int)hms % 100;
gpst.Minute = (((int)hms - gpst.Second) / 100) % 100;
gpst.Hour = (int)hms / 10000;
#endif //PIOS_GPS_PURISTIC
#endif //PIOS_GPS_MINIMAL
// get latitude [DDMM.mmmmm] [N|S]
if (!NMEA_latlon_to_fixed_point(&GpsData->Latitude, param[3], param[4][0] == 'S')) {
@ -459,7 +459,7 @@ static bool nmeaProcessGPRMC(GPSPositionData * GpsData, bool* gpsDataUpdated, ch
// get True course
GpsData->Heading = NMEA_real_to_float(param[8]);
#if !defined(PIOS_GPS_PURISTIC)
#if !defined(PIOS_GPS_MINIMAL)
// get Date of fix
// TODO: Should really not use a float here to be safe
float date = NMEA_real_to_float(param[9]);
@ -468,7 +468,7 @@ static bool nmeaProcessGPRMC(GPSPositionData * GpsData, bool* gpsDataUpdated, ch
gpst.Day = (int)(date / 10000);
gpst.Year += 2000;
GPSTimeSet(&gpst);
#endif //PIOS_GPS_PURISTIC
#endif //PIOS_GPS_MINIMAL
return true;
}
@ -496,7 +496,7 @@ static bool nmeaProcessGPVTG(GPSPositionData * GpsData, bool* gpsDataUpdated, ch
return true;
}
#if !defined(PIOS_GPS_PURISTIC)
#if !defined(PIOS_GPS_MINIMAL)
/**
* Parse an NMEA GPZDA sentence and update the @ref GPSTime object
* \param[in] A pointer to a GPSPosition UAVObject to be updated (unused).
@ -619,7 +619,7 @@ static bool nmeaProcessGPGSV(GPSPositionData * GpsData, bool* gpsDataUpdated, ch
return true;
}
#endif //PIOS_GPS_PURISTIC
#endif //PIOS_GPS_MINIMAL
/**
* Parse an NMEA GPGSA sentence and update the given UAVObject