Skip to content

Commit e5a70fa

Browse files
committed
Add gnssConfiguredOnce/Base/Rover setting/clearing
1 parent 90004dc commit e5a70fa

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

Firmware/RTK_Everywhere/Display.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2384,6 +2384,8 @@ void paintProfile(uint8_t profileUnit)
23842384

23852385
if (profileNumber >= 0)
23862386
{
2387+
settings.gnssConfiguredBase = false; // On the next boot, reapply all settings
2388+
settings.gnssConfiguredRover = false;
23872389
recordSystemSettings(); // Before switching, we need to record the current settings to LittleFS and SD
23882390

23892391
recordProfileNumber(

Firmware/RTK_Everywhere/NVM.ino

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,24 +1572,33 @@ void loadProfileNumber()
15721572
}
15731573
else
15741574
{
1575-
log_d("profileNumber.txt not found");
1575+
systemPrintln("profileNumber.txt not found");
1576+
settings.gnssConfiguredOnce = false; // On the next boot, reapply all settings
1577+
settings.gnssConfiguredBase = false;
1578+
settings.gnssConfiguredRover = false;
15761579
recordProfileNumber(0); // Record profile
15771580
}
15781581
}
15791582
else
15801583
{
1581-
log_d("profileNumber.txt not found");
1584+
systemPrintln("profileNumber.txt not found");
1585+
settings.gnssConfiguredOnce = false; // On the next boot, reapply all settings
1586+
settings.gnssConfiguredBase = false;
1587+
settings.gnssConfiguredRover = false;
15821588
recordProfileNumber(0); // Record profile
15831589
}
15841590

15851591
// We have arbitrary limit of user profiles
15861592
if (profileNumber >= MAX_PROFILE_COUNT)
15871593
{
1588-
log_d("ProfileNumber invalid. Going to zero.");
1594+
systemPrintln("ProfileNumber invalid. Going to zero.");
1595+
settings.gnssConfiguredOnce = false; // On the next boot, reapply all settings
1596+
settings.gnssConfiguredBase = false;
1597+
settings.gnssConfiguredRover = false;
15891598
recordProfileNumber(0); // Record profile
15901599
}
15911600

1592-
log_d("Using profile #%d", profileNumber);
1601+
systemPrintf("Using profile #%d\r\n", profileNumber);
15931602
}
15941603

15951604
// Record the given profile number as well as a config bool

Firmware/RTK_Everywhere/States.ino

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ void stateUpdate()
102102
displayRoverStart(0);
103103
if (gnss->configureRover() == false)
104104
{
105+
settings.gnssConfiguredRover = false; // On the next boot, reapply all settings
105106
recordSystemSettings(); // Record this state for next POR
106107

107108
systemPrintln("Rover config failed");
@@ -122,6 +123,8 @@ void stateUpdate()
122123
displayRoverFail(1000);
123124
else
124125
{
126+
//settings.gnssConfiguredRover is set true by gnss->configureRover()
127+
settings.gnssConfiguredBase = false; // When the mode changes, reapply all settings
125128
settings.lastState = STATE_ROVER_NOT_STARTED;
126129
recordSystemSettings(); // Record this state for next POR
127130

@@ -244,6 +247,8 @@ void stateUpdate()
244247
// Start the UART connected to the GNSS receiver for NMEA and UBX data (enables logging)
245248
if (tasksStartGnssUart() && gnss->configureBase())
246249
{
250+
// settings.gnssConfiguredBase is set true by gnss->configureBase()
251+
settings.gnssConfiguredRover = false; // When the mode changes, reapply all settings
247252
settings.lastState = STATE_BASE_NOT_STARTED; // Record this state for next POR
248253
recordSystemSettings(); // Record this state for next POR
249254

@@ -256,6 +261,7 @@ void stateUpdate()
256261
}
257262
else
258263
{
264+
settings.gnssConfiguredBase = false; // On the next boot, reapply all settings
259265
recordSystemSettings(); // Record this state for next POR
260266

261267
displayBaseFail(1000);
@@ -480,6 +486,9 @@ void stateUpdate()
480486
systemPrintln();
481487

482488
parseIncomingSettings();
489+
settings.gnssConfiguredOnce = false; // On the next boot, reapply all settings
490+
settings.gnssConfiguredBase = false;
491+
settings.gnssConfiguredRover = false;
483492
recordSystemSettings(); // Record these settings to unit
484493

485494
// Clear buffer
@@ -600,6 +609,8 @@ void stateUpdate()
600609
if (tasksStartGnssUart() && configureUbloxModuleNTP())
601610
{
602611
settings.lastState = STATE_NTPSERVER_NOT_STARTED; // Record this state for next POR
612+
settings.gnssConfiguredBase = false; // On the next boot, reapply all settings
613+
settings.gnssConfiguredRover = false;
603614
recordSystemSettings();
604615

605616
if (online.ethernetNTPServer)

Firmware/RTK_Everywhere/menuMain.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,8 @@ void menuUserProfiles()
456456
// Change the active profile number, without unit reset
457457
void changeProfileNumber(byte newProfileNumber)
458458
{
459+
settings.gnssConfiguredBase = false; // On the next boot, reapply all settings
460+
settings.gnssConfiguredRover = false;
459461
recordSystemSettings(); // Before switching, we need to record the current settings to LittleFS and SD
460462

461463
recordProfileNumber(newProfileNumber);
@@ -495,6 +497,8 @@ void factoryReset(bool alreadyHasSemaphore)
495497
sd->remove(stationCoordinateGeodeticFileName);
496498

497499
xSemaphoreGive(sdCardSemaphore);
500+
501+
systemPrintln("Settings files deleted...");
498502
} // End sdCardSemaphore
499503
else
500504
{

0 commit comments

Comments
 (0)