From 02ae5358d59c55a3eb65ead70f78c3e35c929b13 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 4 Mar 2012 20:32:56 +1100 Subject: [PATCH] GPS: fixed some stdint types --- libraries/AP_GPS/AP_GPS_Auto.cpp | 4 ++-- libraries/AP_GPS/AP_GPS_NMEA.cpp | 6 +++--- libraries/AP_GPS/AP_GPS_NMEA.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libraries/AP_GPS/AP_GPS_Auto.cpp b/libraries/AP_GPS/AP_GPS_Auto.cpp index 55807f4c52..78c8411f30 100644 --- a/libraries/AP_GPS/AP_GPS_Auto.cpp +++ b/libraries/AP_GPS/AP_GPS_Auto.cpp @@ -55,7 +55,7 @@ AP_GPS_Auto::read(void) { GPS *gps; uint8_t i; - unsigned long then; + uint32_t then; // Loop through possible baudrates trying to detect a GPS at one of them. // @@ -96,7 +96,7 @@ AP_GPS_Auto::read(void) GPS * AP_GPS_Auto::_detect(void) { - unsigned long then; + uint32_t then; uint8_t fingerprint[4]; uint8_t tries; uint16_t charcount; diff --git a/libraries/AP_GPS/AP_GPS_NMEA.cpp b/libraries/AP_GPS/AP_GPS_NMEA.cpp index 473601b9d6..15bc788d5a 100644 --- a/libraries/AP_GPS/AP_GPS_NMEA.cpp +++ b/libraries/AP_GPS/AP_GPS_NMEA.cpp @@ -184,10 +184,10 @@ int AP_GPS_NMEA::_from_hex(char a) return a - '0'; } -unsigned long AP_GPS_NMEA::_parse_decimal() +uint32_t AP_GPS_NMEA::_parse_decimal() { char *p = _term; - unsigned long ret = 100UL * atol(p); + uint32_t ret = 100UL * atol(p); while (isdigit(*p)) ++p; if (*p == '.') { @@ -200,7 +200,7 @@ unsigned long AP_GPS_NMEA::_parse_decimal() return ret; } -unsigned long AP_GPS_NMEA::_parse_degrees() +uint32_t AP_GPS_NMEA::_parse_degrees() { char *p, *q; uint8_t deg = 0, min = 0; diff --git a/libraries/AP_GPS/AP_GPS_NMEA.h b/libraries/AP_GPS/AP_GPS_NMEA.h index 546480e97e..23be743ba8 100644 --- a/libraries/AP_GPS/AP_GPS_NMEA.h +++ b/libraries/AP_GPS/AP_GPS_NMEA.h @@ -96,7 +96,7 @@ private: /// @returns The value expressed by the string in _term, /// multiplied by 100. /// - unsigned long _parse_decimal(); + uint32_t _parse_decimal(); /// Parses the current term as a NMEA-style degrees + minutes /// value with up to four decimal digits. @@ -106,7 +106,7 @@ private: /// @returns The value expressed by the string in _term, /// multiplied by 10000. /// - unsigned long _parse_degrees(); + uint32_t _parse_degrees(); /// Processes the current term when it has been deemed to be /// complete.