Skip to content

Commit 01326d8

Browse files
committed
Add factory reset option via serial from GNSS Fail.
1 parent f61b7ae commit 01326d8

File tree

2 files changed

+45
-5
lines changed

2 files changed

+45
-5
lines changed

Firmware/RTK_Surveyor/Begin.ino

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,29 @@ void beginGNSS()
329329
delay(1000); //Wait for ZED-F9P to power up before it can respond to ACK
330330
if (i2cGNSS.begin() == false)
331331
{
332-
Serial.println(F("u-blox GNSS not detected at default I2C address. Hard stop."));
332+
if (productVariant == RTK_SURVEYOR)
333+
blinkError(ERROR_NO_I2C); //Infinite loop
334+
333335
displayGNSSFail(0);
334-
blinkError(ERROR_NO_I2C);
336+
337+
//Present user with prompt to factory reset unit over serial
338+
while (1)
339+
{
340+
Serial.println(F("GNSS Error: u-blox GNSS not detected at default I2C address. Press 'r' to factory reset."));
341+
byte incoming = getByteChoice(2); //Timeout after x seconds
342+
343+
if (incoming == 'r')
344+
{
345+
Serial.println(F("\r\nResetting to factory defaults. Press 'y' to confirm:"));
346+
byte bContinue = getByteChoice(menuTimeout);
347+
if (bContinue == 'y')
348+
{
349+
factoryReset();
350+
}
351+
else
352+
Serial.println(F("Reset aborted"));
353+
}
354+
}
335355
}
336356
}
337357

@@ -394,9 +414,29 @@ void configureGNSS()
394414

395415
if (response == false)
396416
{
397-
Serial.println(F("Failed to configure module. Hard stop."));
417+
if (productVariant == RTK_SURVEYOR)
418+
blinkError(ERROR_GPS_CONFIG_FAIL); //Infinite loop
419+
398420
displayGNSSFail(0);
399-
blinkError(ERROR_GPS_CONFIG_FAIL);
421+
422+
//Present user with prompt to factory reset unit over serial
423+
while (1)
424+
{
425+
Serial.println(F("GNSS Error: Failed to configure module. Press 'r' to factory reset."));
426+
byte incoming = getByteChoice(2); //Timeout after x seconds
427+
428+
if (incoming == 'r')
429+
{
430+
Serial.println(F("\r\nResetting to factory defaults. Press 'y' to confirm:"));
431+
byte bContinue = getByteChoice(menuTimeout);
432+
if (bContinue == 'y')
433+
{
434+
factoryReset();
435+
}
436+
else
437+
Serial.println(F("Reset aborted"));
438+
}
439+
}
400440
}
401441
}
402442

Firmware/RTK_Surveyor/RTK_Surveyor.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
*/
4949

5050
const int FIRMWARE_VERSION_MAJOR = 1;
51-
const int FIRMWARE_VERSION_MINOR = 11;
51+
const int FIRMWARE_VERSION_MINOR = 10;
5252

5353
#define COMPILE_WIFI //Comment out to remove all WiFi functionality
5454
#define COMPILE_BT //Comment out to disable all Bluetooth

0 commit comments

Comments
 (0)