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

Commit 7f2d6d0

Browse files
authored
Merge pull request #47 from tedder/tedder/time_of_week_without_hppos
allow TimeOfWeek to be sourced from basic NAV
2 parents f2852f3 + fbd6af7 commit 7f2d6d0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/SparkFun_Ublox_Arduino_Library.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,7 @@ void SFE_UBLOX_GPS::processUBXpacket(ubxPacket *msg)
585585
//Parse various byte fields into global vars
586586
constexpr int startingSpot = 0; //fixed value used in processUBX
587587

588+
timeOfWeek = extractLong(0);
588589
gpsMillisecond = extractLong(0) % 1000; //Get last three digits of iTOW
589590
gpsYear = extractInt(4);
590591
gpsMonth = extractByte(6);
@@ -639,14 +640,14 @@ void SFE_UBLOX_GPS::processUBXpacket(ubxPacket *msg)
639640
verticalAccuracy = extractLong(32);
640641

641642
highResModuleQueried.all = true;
642-
highResModuleQueried.timeOfWeek = true;
643643
highResModuleQueried.highResLatitude = true;
644644
highResModuleQueried.highResLongitude = true;
645645
highResModuleQueried.elipsoid = true;
646646
highResModuleQueried.meanSeaLevel = true;
647647
highResModuleQueried.geoidSeparation = true;
648648
highResModuleQueried.horizontalAccuracy = true;
649649
highResModuleQueried.verticalAccuracy = true;
650+
moduleQueried.gpsiTOW = true; // this can arrive via HPPOS too.
650651

651652
if (_printDebug == true)
652653
{
@@ -1765,12 +1766,13 @@ boolean SFE_UBLOX_GPS::getPVT(uint16_t maxWait)
17651766

17661767
uint32_t SFE_UBLOX_GPS::getTimeOfWeek(uint16_t maxWait /* = 250*/)
17671768
{
1768-
if (highResModuleQueried.timeOfWeek == false)
1769-
getHPPOSLLH();
1770-
highResModuleQueried.timeOfWeek = false; //Since we are about to give this to user, mark this data as stale
1769+
if (moduleQueried.gpsiTOW == false)
1770+
getPVT();
1771+
moduleQueried.gpsiTOW = false; //Since we are about to give this to user, mark this data as stale
17711772
return (timeOfWeek);
17721773
}
17731774

1775+
17741776
int32_t SFE_UBLOX_GPS::getHighResLatitude(uint16_t maxWait /* = 250*/)
17751777
{
17761778
if (highResModuleQueried.highResLatitude == false)

0 commit comments

Comments
 (0)