Skip to content

Commit b4aa69b

Browse files
committed
Trigger factory reset if GNSS config data will cause system lock.
1 parent c616989 commit b4aa69b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Firmware/RTK_Surveyor/NVM.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ void recordSystemSettings()
8686
delay(1); //Give CPU time to pet WDT
8787
}
8888
else
89+
{
8990
ESP_LOGD(TAG, "Error: EEPROM not online");
91+
}
9092

9193
recordSystemSettingsToFile();
9294
}

Firmware/RTK_Surveyor/menuGNSS.ino

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ void menuConstellations()
163163
if (incoming >= 1 && incoming <= MAX_CONSTELLATIONS)
164164
{
165165
incoming--; //Align choice to constallation array of 0 to 5
166-
166+
167167
settings.ubxConstellations[incoming].enabled ^= 1;
168168

169169
//3.10.6: To avoid cross-correlation issues, it is recommended that GPS and QZSS are always both enabled or both disabled.
@@ -254,6 +254,14 @@ bool configureConstellations()
254254
{
255255
bool response = true;
256256

257+
//If we have a corrupt constellation ID it can cause GNSS config to fail.
258+
//Reset to factory defaults.
259+
if (settings.ubxConstellations[0].gnssID == 255)
260+
{
261+
ESP_LOGD(TAG, "Constellation ID corrupt");
262+
factoryReset();
263+
}
264+
257265
//long startTime = millis();
258266
for (int x = 0 ; x < MAX_CONSTELLATIONS ; x++)
259267
{

0 commit comments

Comments
 (0)