Skip to content

Commit 9abe330

Browse files
committed
UM980: add gnssConfiguredOnce/Base/Rover
1 parent 1c4dd1f commit 9abe330

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

Firmware/RTK_Everywhere/GNSS_UM980.ino

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,13 @@ bool GNSS_UM980::configureBase()
166166
return (false);
167167
}
168168

169+
if (settings.gnssConfiguredBase)
170+
{
171+
if (settings.debugGnss)
172+
systemPrintln("Skipping UM980 Base configuration");
173+
return true;
174+
}
175+
169176
disableAllOutput();
170177

171178
bool response = true;
@@ -186,7 +193,7 @@ bool GNSS_UM980::configureBase()
186193
response &= enableNMEA();
187194

188195
// Save the current configuration into non-volatile memory (NVM)
189-
_um980->saveConfiguration();
196+
response &= _um980->saveConfiguration();
190197

191198
if (response == false)
192199
{
@@ -196,6 +203,8 @@ bool GNSS_UM980::configureBase()
196203
if (settings.debugGnss)
197204
systemPrintln("UM980 Base configured");
198205

206+
settings.gnssConfiguredBase = response;
207+
199208
return (response);
200209
}
201210

@@ -216,6 +225,12 @@ bool GNSS_UM980::configureOnce()
216225
Enable selected RTCM messages on COM3
217226
*/
218227

228+
if (settings.gnssConfiguredOnce)
229+
{
230+
systemPrintln("UM980 configuration maintained");
231+
return (true);
232+
}
233+
219234
if (settings.debugGnss)
220235
debuggingEnable(); // Print all debug to Serial
221236

@@ -266,11 +281,13 @@ bool GNSS_UM980::configureOnce()
266281
systemPrintln("UM980 configuration updated");
267282

268283
// Save the current configuration into non-volatile memory (NVM)
269-
_um980->saveConfiguration();
284+
response &= _um980->saveConfiguration();
270285
}
271286
else
272287
online.gnss = false; // Take it offline
273288

289+
settings.gnssConfiguredOnce = response;
290+
274291
return (response);
275292
}
276293

@@ -325,6 +342,13 @@ bool GNSS_UM980::configureRover()
325342
return (false);
326343
}
327344

345+
// If our settings haven't changed, trust GNSS's settings
346+
if (settings.gnssConfiguredRover)
347+
{
348+
systemPrintln("Skipping UM980 Rover configuration");
349+
return (true);
350+
}
351+
328352
disableAllOutput();
329353

330354
bool response = true;
@@ -355,13 +379,15 @@ bool GNSS_UM980::configureRover()
355379
response &= enableNMEA();
356380

357381
// Save the current configuration into non-volatile memory (NVM)
358-
_um980->saveConfiguration();
382+
response &= _um980->saveConfiguration();
359383

360384
if (response == false)
361385
{
362386
systemPrintln("UM980 Rover failed to configure");
363387
}
364388

389+
settings.gnssConfiguredRover = response;
390+
365391
return (response);
366392
}
367393

@@ -1407,6 +1433,10 @@ void GNSS_UM980::menuMessagesSubtype(float *localMessageRate, const char *messag
14071433
printUnknown(incoming);
14081434
}
14091435

1436+
settings.gnssConfiguredOnce = false; // Update the GNSS config at the next boot
1437+
settings.gnssConfiguredBase = false;
1438+
settings.gnssConfiguredRover = false;
1439+
14101440
clearBuffer(); // Empty buffer of any newline chars
14111441
}
14121442

0 commit comments

Comments
 (0)