Skip to content

Commit 0685cbc

Browse files
committed
Add system state check. NVM loadSettings doesn't catch all EEPROM movement errors.
1 parent 5b5529d commit 0685cbc

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Firmware/RTK_Surveyor/Begin.ino

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,12 +475,25 @@ void beginSystemState()
475475
{
476476
systemState = settings.lastState; //Return to system state previous to power down.
477477

478+
if (systemState > STATE_SHUTDOWN)
479+
{
480+
Serial.println("Unknown state - factory reset");
481+
factoryReset();
482+
}
483+
478484
setupBtn = new Button(pin_setupButton); //Create the button in memory
479485
powerBtn = new Button(pin_powerSenseAndControl); //Create the button in memory
480486
}
481487
else if (productVariant == RTK_FACET)
482488
{
483489
systemState = settings.lastState; //Return to system state previous to power down.
490+
491+
if (systemState > STATE_SHUTDOWN)
492+
{
493+
Serial.println("Unknown state - factory reset");
494+
factoryReset();
495+
}
496+
484497
if (systemState == STATE_ROVER_NOT_STARTED)
485498
firstRoverStart = true; //Allow user to enter test screen during first rover start
486499

0 commit comments

Comments
 (0)