From 8173c7b7c63dd96f5a4a5aa88cd6dda2367bc47c Mon Sep 17 00:00:00 2001 From: Corvus Corax Date: Thu, 25 Aug 2011 15:44:49 +0200 Subject: [PATCH] Refactor GPS_PURISTIC into GPS_MINIMAL --- flight/CopterControl/System/inc/pios_config.h | 2 +- flight/Modules/GPS/GPS.c | 2 +- flight/Modules/GPS/NMEA.c | 20 +++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/flight/CopterControl/System/inc/pios_config.h b/flight/CopterControl/System/inc/pios_config.h index 99fb0ace3..3dbb727e9 100644 --- a/flight/CopterControl/System/inc/pios_config.h +++ b/flight/CopterControl/System/inc/pios_config.h @@ -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 diff --git a/flight/Modules/GPS/GPS.c b/flight/Modules/GPS/GPS.c index 6b8138757..cee26c217 100644 --- a/flight/Modules/GPS/GPS.c +++ b/flight/Modules/GPS/GPS.c @@ -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 diff --git a/flight/Modules/GPS/NMEA.c b/flight/Modules/GPS/NMEA.c index a69b174d9..4f78b27a4 100644 --- a/flight/Modules/GPS/NMEA.c +++ b/flight/Modules/GPS/NMEA.c @@ -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