Skip to content

Commit 1c4dd1f

Browse files
committed
mosaic: add gnssConfiguredOnce/Base/Rover
1 parent e311c54 commit 1c4dd1f

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

Firmware/RTK_Everywhere/GNSS_Mosaic.ino

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,13 @@ bool GNSS_MOSAIC::configureBase()
406406
return (false);
407407
}
408408

409+
if (settings.gnssConfiguredBase)
410+
{
411+
if (settings.debugGnss)
412+
systemPrintln("Skipping mosaic Base configuration");
413+
return true;
414+
}
415+
409416
bool response = true;
410417

411418
response &= setModel(MOSAIC_DYN_MODEL_STATIC);
@@ -421,13 +428,15 @@ bool GNSS_MOSAIC::configureBase()
421428
setLoggingType(); // Update Standard, PPP, or custom for icon selection
422429

423430
// Save the current configuration into non-volatile memory (NVM)
424-
saveConfiguration();
431+
response &= saveConfiguration();
425432

426433
if (response == false)
427434
{
428435
systemPrintln("mosaic-X5 Base failed to configure");
429436
}
430437

438+
settings.gnssConfiguredBase = response;
439+
431440
return (response);
432441
}
433442

@@ -542,6 +551,12 @@ bool GNSS_MOSAIC::configureOnce()
542551
RTCMv3 messages are enabled by enableRTCMRover / enableRTCMBase
543552
*/
544553

554+
if (settings.gnssConfiguredOnce)
555+
{
556+
systemPrintln("mosaic configuration maintained");
557+
return (true);
558+
}
559+
545560
bool response = true;
546561

547562
// Configure COM1. NMEA and RTCMv3 will be encapsulated in SBF format
@@ -589,11 +604,13 @@ bool GNSS_MOSAIC::configureOnce()
589604
systemPrintln("mosaic-X5 configuration updated");
590605

591606
// Save the current configuration into non-volatile memory (NVM)
592-
saveConfiguration();
607+
response &= saveConfiguration();
593608
}
594609
else
595610
online.gnss = false; // Take it offline
596611

612+
settings.gnssConfiguredOnce = response;
613+
597614
return (response);
598615
}
599616

@@ -635,6 +652,13 @@ bool GNSS_MOSAIC::configureRover()
635652
return (false);
636653
}
637654

655+
// If our settings haven't changed, trust GNSS's settings
656+
if (settings.gnssConfiguredRover)
657+
{
658+
systemPrintln("Skipping mosaic Rover configuration");
659+
return (true);
660+
}
661+
638662
bool response = true;
639663

640664
response &= sendWithResponse("spm,Rover,all,auto\n\r", "PVTMode");
@@ -652,13 +676,15 @@ bool GNSS_MOSAIC::configureRover()
652676
setLoggingType(); // Update Standard, PPP, or custom for icon selection
653677

654678
// Save the current configuration into non-volatile memory (NVM)
655-
saveConfiguration();
679+
response &= saveConfiguration();
656680

657681
if (response == false)
658682
{
659683
systemPrintln("mosaic-X5 Rover failed to configure");
660684
}
661685

686+
settings.gnssConfiguredRover = response;
687+
662688
return (response);
663689
}
664690

@@ -1697,6 +1723,9 @@ void GNSS_MOSAIC::menuMessagesNMEA()
16971723
printUnknown(incoming);
16981724
}
16991725

1726+
settings.gnssConfiguredBase = false; // Update the GNSS config at the next boot
1727+
settings.gnssConfiguredRover = false;
1728+
17001729
clearBuffer(); // Empty buffer of any newline chars
17011730
}
17021731

@@ -1766,6 +1795,9 @@ void GNSS_MOSAIC::menuMessagesRTCM(bool rover)
17661795
printUnknown(incoming);
17671796
}
17681797

1798+
settings.gnssConfiguredBase = false; // Update the GNSS config at the next boot
1799+
settings.gnssConfiguredRover = false;
1800+
17691801
clearBuffer(); // Empty buffer of any newline chars
17701802
}
17711803

0 commit comments

Comments
 (0)