Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

allow TimeOfWeek to be sourced from basic NAV #47

Merged
merged 2 commits into from
Nov 20, 2019
Merged
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
10 changes: 6 additions & 4 deletions src/SparkFun_Ublox_Arduino_Library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,7 @@ void SFE_UBLOX_GPS::processUBXpacket(ubxPacket *msg)
//Parse various byte fields into global vars
constexpr int startingSpot = 0; //fixed value used in processUBX

timeOfWeek = extractLong(0);
gpsMillisecond = extractLong(0) % 1000; //Get last three digits of iTOW
gpsYear = extractInt(4);
gpsMonth = extractByte(6);
Expand Down Expand Up @@ -655,14 +656,14 @@ void SFE_UBLOX_GPS::processUBXpacket(ubxPacket *msg)
verticalAccuracy = extractLong(32);

highResModuleQueried.all = true;
highResModuleQueried.timeOfWeek = true;
highResModuleQueried.highResLatitude = true;
highResModuleQueried.highResLongitude = true;
highResModuleQueried.elipsoid = true;
highResModuleQueried.meanSeaLevel = true;
highResModuleQueried.geoidSeparation = true;
highResModuleQueried.horizontalAccuracy = true;
highResModuleQueried.verticalAccuracy = true;
moduleQueried.gpsiTOW = true; // this can arrive via HPPOS too.

if (_printDebug == true)
{
Expand Down Expand Up @@ -1781,12 +1782,13 @@ boolean SFE_UBLOX_GPS::getPVT(uint16_t maxWait)

uint32_t SFE_UBLOX_GPS::getTimeOfWeek(uint16_t maxWait /* = 250*/)
{
if (highResModuleQueried.timeOfWeek == false)
getHPPOSLLH();
highResModuleQueried.timeOfWeek = false; //Since we are about to give this to user, mark this data as stale
if (moduleQueried.gpsiTOW == false)
getPVT();
moduleQueried.gpsiTOW = false; //Since we are about to give this to user, mark this data as stale
return (timeOfWeek);
}


int32_t SFE_UBLOX_GPS::getHighResLatitude(uint16_t maxWait /* = 250*/)
{
if (highResModuleQueried.highResLatitude == false)
Expand Down