From a057d83d5e5a5dd3129edd3b793dbbef3462087e Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Tue, 6 Jun 2017 23:38:38 +0200 Subject: [PATCH] Do not use fixed width integer types for the TinyGPS example, as this causes issues on the ESP8266 platform --- examples/pl2303/pl2303_tinygps/pl2303_tinygps.ino | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/pl2303/pl2303_tinygps/pl2303_tinygps.ino b/examples/pl2303/pl2303_tinygps/pl2303_tinygps.ino index 8b30622d..af13b6bc 100644 --- a/examples/pl2303/pl2303_tinygps/pl2303_tinygps.ino +++ b/examples/pl2303/pl2303_tinygps/pl2303_tinygps.ino @@ -150,12 +150,12 @@ void printFloat(double number, int16_t digits) void gpsdump(TinyGPS &gps) { - int32_t lat, lon; + long lat, lon; float flat, flon; - uint32_t age, date, time, chars; - int16_t year; + unsigned long age, date, time, chars; + int year; uint8_t month, day, hour, minute, second, hundredths; - uint16_t sentences, failed; + unsigned short sentences, failed; gps.get_position(&lat, &lon, &age); Serial.print("Lat/Long(10^-5 deg): "); Serial.print(lat); Serial.print(", "); Serial.print(lon); @@ -175,7 +175,7 @@ void gpsdump(TinyGPS &gps) feedgps(); - gps.crack_datetime((int*)&year, &month, &day, &hour, &minute, &second, &hundredths, &age); + gps.crack_datetime(&year, &month, &day, &hour, &minute, &second, &hundredths, &age); Serial.print("Date: "); Serial.print(static_cast(month)); Serial.print("/"); Serial.print(static_cast(day)); Serial.print("/"); Serial.print(year); Serial.print(" Time: "); Serial.print(static_cast(hour)); Serial.print(":"); Serial.print(static_cast(minute)); Serial.print(":"); Serial.print(static_cast(second)); Serial.print("."); Serial.print(static_cast(hundredths)); Serial.print(" Fix age: "); Serial.print(age); Serial.println("ms."); @@ -189,7 +189,7 @@ void gpsdump(TinyGPS &gps) feedgps(); - gps.stats(&chars, (unsigned short*)&sentences, (unsigned short*)&failed); + gps.stats(&chars, &sentences, &failed); Serial.print("Stats: characters: "); Serial.print(chars); Serial.print(" sentences: "); Serial.print(sentences); Serial.print(" failed checksum: "); Serial.println(failed); }