summaryrefslogtreecommitdiff
path: root/libraries/TinyGPS
diff options
context:
space:
mode:
authorStanley Huang <stanleyhuangyc@gmail.com>2017-05-26 15:10:15 +1000
committerStanley Huang <stanleyhuangyc@gmail.com>2017-05-26 15:10:15 +1000
commit2a4c9fa5da5ae92b3d277e1cd41a5b86ae8dbcd1 (patch)
tree6ffc92d3f0c40c7d5d0ad78b1a34215fb9f03249 /libraries/TinyGPS
parent821eb39d129954138ae929865a2b52997bce089b (diff)
download2021-arduino-obd-2a4c9fa5da5ae92b3d277e1cd41a5b86ae8dbcd1.tar.gz
2021-arduino-obd-2a4c9fa5da5ae92b3d277e1cd41a5b86ae8dbcd1.tar.bz2
2021-arduino-obd-2a4c9fa5da5ae92b3d277e1cd41a5b86ae8dbcd1.zip
Increased coordinates precision
Diffstat (limited to 'libraries/TinyGPS')
-rw-r--r--libraries/TinyGPS/TinyGPS.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libraries/TinyGPS/TinyGPS.cpp b/libraries/TinyGPS/TinyGPS.cpp
index a3f5a1e..5a5b86b 100644
--- a/libraries/TinyGPS/TinyGPS.cpp
+++ b/libraries/TinyGPS/TinyGPS.cpp
@@ -143,18 +143,18 @@ unsigned long TinyGPS::parse_degrees()
{
char *p;
unsigned long left = gpsatol(_term);
- unsigned long tenk_minutes = (left % 100UL) * 10000UL;
+ unsigned long tenk_minutes = (left % 100UL) * 100000UL;
for (p=_term; gpsisdigit(*p); ++p);
if (*p == '.')
{
- unsigned long mult = 1000;
+ unsigned long mult = 10000;
while (gpsisdigit(*++p))
{
tenk_minutes += mult * (*p - '0');
mult /= 10;
}
}
- return (left / 100) * 100000 + tenk_minutes / 6;
+ return (left / 100) * 1000000 + tenk_minutes / 6;
}
#define COMBINE(sentence_type, term_number) (((unsigned)(sentence_type) << 5) | term_number)