Skip to content

Commit bb33fa9

Browse files
authored
Merge pull request #65 from sparkfun/release_candidate
v3.1.7 - improve performance of getTIMTPAsEpoch
2 parents 4a73b78 + 729f5cc commit bb33fa9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=SparkFun u-blox GNSS v3
2-
version=3.1.6
2+
version=3.1.7
33
author=SparkFun Electronics <[email protected]>
44
maintainer=SparkFun Electronics <sparkfun.com>
55
sentence=Library for I2C, Serial and SPI Communication with u-blox GNSS modules<br/><br/>

src/u-blox_GNSS.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -18477,9 +18477,9 @@ uint32_t DevUBLOXGNSS::getTIMTPAsEpoch(uint32_t &microsecond, uint16_t maxWait)
1847718477
uint32_t us = packetUBXTIMTP->data.towMS % 1000; // Extract the milliseconds
1847818478
us *= 1000; // Convert to microseconds
1847918479

18480-
double subMS = packetUBXTIMTP->data.towSubMS; // Get towSubMS (ms * 2^-32)
18481-
subMS *= pow(2.0, -32.0); // Convert to milliseconds
18482-
subMS *= 1000; // Convert to microseconds
18480+
double subMS = packetUBXTIMTP->data.towSubMS; // Get towSubMS (ms * 2^-32)
18481+
subMS *= 2.3283064365386963e-10; // pow(2.0, -32.0); // Convert to milliseconds
18482+
subMS *= 1000; // Convert to microseconds
1848318483

1848418484
us += (uint32_t)subMS; // Add subMS
1848518485

0 commit comments

Comments
 (0)