Skip to content

Commit 3a1888e

Browse files
committed
Rename unixEpochToWeekToW
1 parent 9a82d18 commit 3a1888e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Firmware/RTK_Surveyor/menuPP.ino

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -746,10 +746,10 @@ long long dateToGPSEpoch(uint8_t day, uint8_t month, uint16_t year)
746746
}
747747

748748
// Given an epoch, set the GPSWeek and GPSToW
749-
void unixEpochToWeekToW(long long unixEpoch, uint16_t *GPSWeek, uint32_t *GPSToW)
749+
void epochToWeekToW(long long epoch, uint16_t *GPSWeek, uint32_t *GPSToW)
750750
{
751-
*GPSWeek = (uint16_t)(unixEpoch / (7 * 24 * 60 * 60));
752-
*GPSToW = (uint32_t)(unixEpoch % (7 * 24 * 60 * 60));
751+
*GPSWeek = (uint16_t)(epoch / (7 * 24 * 60 * 60));
752+
*GPSToW = (uint32_t)(epoch % (7 * 24 * 60 * 60));
753753
}
754754

755755
// Given an epoch, set the GPSWeek and GPSToW
@@ -813,6 +813,8 @@ void dateToKeyStartDuration(uint8_t expDay, uint8_t expMonth, uint16_t expYear,
813813
long long gpsEpoch = thingstreamEpochToGPSEpoch(*settingsKeyStart);
814814

815815
if (ENABLE_DEVELOPER)
816+
epochToWeekToW(gpsEpoch, &keyGPSWeek, &keyGPSToW);
817+
816818
{
817819
systemPrintf(" KeyStart: %lld\r\n", *settingsKeyStart);
818820
systemPrintf(" KeyDuration: %lld\r\n", *settingsKeyDuration);
@@ -914,10 +916,12 @@ void pointperfectApplyKeys()
914916
uint16_t currentKeyGPSWeek;
915917
uint32_t currentKeyGPSToW;
916918
long long epoch = thingstreamEpochToGPSEpoch(settings.pointPerfectCurrentKeyStart);
919+
epochToWeekToW(epoch, &currentKeyGPSWeek, &currentKeyGPSToW);
917920

918921
uint16_t nextKeyGPSWeek;
919922
uint32_t nextKeyGPSToW;
920923
epoch = thingstreamEpochToGPSEpoch(settings.pointPerfectNextKeyStart);
924+
epochToWeekToW(epoch, &nextKeyGPSWeek, &nextKeyGPSToW);
921925

922926
theGNSS.setVal8(UBLOX_CFG_SPARTN_USE_SOURCE, 1); // use LBAND PMP message
923927

0 commit comments

Comments
 (0)