Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.1.7 - improve performance of getTIMTPAsEpoch #65

Merged
merged 3 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=SparkFun u-blox GNSS v3
version=3.1.6
version=3.1.7
author=SparkFun Electronics <[email protected]>
maintainer=SparkFun Electronics <sparkfun.com>
sentence=Library for I2C, Serial and SPI Communication with u-blox GNSS modules<br/><br/>
Expand Down
6 changes: 3 additions & 3 deletions src/u-blox_GNSS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18477,9 +18477,9 @@ uint32_t DevUBLOXGNSS::getTIMTPAsEpoch(uint32_t &microsecond, uint16_t maxWait)
uint32_t us = packetUBXTIMTP->data.towMS % 1000; // Extract the milliseconds
us *= 1000; // Convert to microseconds

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

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

Expand Down