@@ -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\n Resetting 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\n Resetting 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
0 commit comments