Skip to content

Commit f7b639b

Browse files
LeeLeahy2nseidle
authored andcommitted
Periodically display the position
1 parent a9a16a4 commit f7b639b

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

Firmware/RTK_Surveyor/NVM.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ void recordSystemSettingsToFile(File * settingsFile)
236236
settingsFile->printf("%s=%d\n\r", F("enablePrintNtripClientState"), settings.enablePrintNtripClientState);
237237
settingsFile->printf("%s=%d\n\r", F("enablePrintNtripServerState"), settings.enablePrintNtripServerState);
238238
settingsFile->printf("%s=%d\n\r", F("enablePrintNtripServerRtcm"), settings.enablePrintNtripServerRtcm);
239+
settingsFile->printf("%s=%d\n\r", F("enablePrintPosition"), settings.enablePrintPosition);
239240
settingsFile->printf("%s=%d\n\r", F("enableMarksFile"), settings.enableMarksFile);
240241

241242
//Record constellation settings
@@ -807,6 +808,8 @@ bool parseLine(char* str, Settings *settings)
807808
settings->enablePrintNtripServerState = d;
808809
else if (strcmp(settingName, "enablePrintNtripServerRtcm") == 0)
809810
settings->enablePrintNtripServerRtcm = d;
811+
else if (strcmp(settingName, "enablePrintPosition") == 0)
812+
settings->enablePrintPosition = d;
810813

811814
//Check for bulk settings (constellations and message rates)
812815
//Must be last on else list

Firmware/RTK_Surveyor/RTK_Surveyor.ino

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ uint32_t lastHeapReport = 0; //Report heap every 1s if option enabled
358358
uint32_t lastTaskHeapReport = 0; //Report task heap every 1s if option enabled
359359
uint32_t lastCasterLEDupdate = 0; //Controls the cycling of position LEDs during casting
360360
uint32_t lastRTCAttempt = 0; //Wait 1000ms between checking GNSS for current date/time
361+
uint32_t lastPrintPosition = 0; //For periodic display of the position
361362

362363
uint32_t lastBaseIconUpdate = 0;
363364
bool baseIconDisplayed = false; //Toggles as lastBaseIconUpdate goes above 1000ms
@@ -489,6 +490,13 @@ void loop()
489490

490491
updateLBand(); //Check if we've recently received PointPerfect corrections or not
491492

493+
//Periodically print the position
494+
if (settings.enablePrintPosition && ((millis() - lastPrintPosition) > 15000))
495+
{
496+
printCurrentConditions();
497+
lastPrintPosition = millis();
498+
}
499+
492500
//Convert current system time to minutes. This is used in F9PSerialReadTask()/updateLogs() to see if we are within max log window.
493501
systemTime_minutes = millis() / 1000L / 60;
494502

Firmware/RTK_Surveyor/menuSystem.ino

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,9 @@ void menuDebug()
298298
Serial.print(F("15) Print GNSS --> NTRIP caster messages: "));
299299
Serial.printf("%s\r\n", settings.enablePrintNtripServerRtcm ? "Enabled" : "Disabled");
300300

301+
Serial.print(F("16) Periodically print position: "));
302+
Serial.printf("%s\r\n", settings.enablePrintPosition ? "Enabled" : "Disabled");
303+
301304
Serial.println(F("t) Enter Test Screen"));
302305

303306
Serial.println(F("e) Erase LittleFS"));
@@ -422,6 +425,10 @@ void menuDebug()
422425
{
423426
settings.enablePrintNtripServerRtcm ^= 1;
424427
}
428+
else if (incoming == 16)
429+
{
430+
settings.enablePrintPosition ^= 1;
431+
}
425432
else
426433
printUnknown(incoming);
427434
}

Firmware/RTK_Surveyor/settings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ typedef struct {
431431
bool enablePrintNtripClientState = false;
432432
bool enablePrintNtripServerState = false;
433433
bool enablePrintNtripServerRtcm = false;
434+
bool enablePrintPosition = false;
434435
} Settings;
435436
Settings settings;
436437

0 commit comments

Comments
 (0)