Skip to content

Commit 03f426e

Browse files
committed
Add printRTKState
1 parent 91567db commit 03f426e

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

Firmware/RTK_Surveyor/RTK_Surveyor.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@ uint32_t lastRTCAttempt = 0; // Wait 1000ms between checking GNSS for curre
631631
uint32_t lastRTCSync = 0; // Time in millis when the RTC was last sync'd
632632
bool rtcSyncd = false; // Set to true when the RTC has been sync'd via TP pulse
633633
uint32_t lastPrintPosition = 0; // For periodic display of the position
634+
uint32_t lastPrintState = 0; // For periodic display of the RTK state (solution)
634635

635636
uint32_t lastBaseIconUpdate = 0;
636637
bool baseIconDisplayed = false; // Toggles as lastBaseIconUpdate goes above 1000ms
@@ -1033,6 +1034,9 @@ void loop()
10331034
DMW_c("printPosition");
10341035
printPosition(); // Periodically print GNSS coordinates if enabled
10351036

1037+
DMW_c("printRTKState");
1038+
printRTKState(); // Periodically print RTK state (solution) if enabled
1039+
10361040
// A small delay prevents panic if no other I2C or functions are called
10371041
delay(10);
10381042
}

Firmware/RTK_Surveyor/System.ino

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,17 @@ void printPosition()
883883
}
884884
}
885885

886+
// Periodically print RTK state if enabled
887+
void printRTKState()
888+
{
889+
// Periodically print the RTK state
890+
if (settings.enablePrintState && ((millis() - lastPrintState) > 15000))
891+
{
892+
printCurrentRTKState();
893+
lastPrintState = millis();
894+
}
895+
}
896+
886897
// Given a user's string, try to identify the type and return the coordinate in DD.ddddddddd format
887898
CoordinateInputType coordinateIdentifyInputType(const char *userEntryOriginal, double *coordinate)
888899
{

Firmware/RTK_Surveyor/menuSystem.ino

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,6 +1430,28 @@ void printCurrentConditions()
14301430
}
14311431
}
14321432

1433+
void printCurrentRTKState()
1434+
{
1435+
if (online.gnss == true)
1436+
{
1437+
systemPrint("RTK solution: ");
1438+
1439+
if (carrSoln == 0) // No RTK
1440+
systemPrint("NONE");
1441+
1442+
else if (carrSoln == 1) // RTK Float
1443+
systemPrint("FLOAT");
1444+
1445+
else if (carrSoln == 2) // RTK Fix
1446+
systemPrint("FIX");
1447+
1448+
else
1449+
systemPrint("UNKNOWN!");
1450+
1451+
systemPrintln();
1452+
}
1453+
}
1454+
14331455
void printCurrentConditionsNMEA()
14341456
{
14351457
if (online.gnss == true)

0 commit comments

Comments
 (0)