Skip to content

Commit 262ab2f

Browse files
committed
Always update resetCount to aid uptime print
1 parent 40b3d29 commit 262ab2f

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

Firmware/RTK_Surveyor/Begin.ino

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -147,28 +147,16 @@ void beginBoard()
147147
unitMACAddress[5] += 2; //Convert MAC address to Bluetooth MAC (add 2): https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/system.html#mac-address
148148

149149
//For all boards, check reset reason. If reset was due to wdt or panic, append last log
150+
loadSettingsPartial(); //Get resetCount
150151
if (esp_reset_reason() == ESP_RST_POWERON)
151152
{
152153
reuseLastLog = false; //Start new log
153-
154-
loadSettingsPartial();
155-
if (settings.enableResetDisplay == true)
156-
{
157-
settings.resetCount = 0;
158-
recordSystemSettings(); //Record to NVM
159-
}
154+
settings.resetCount = 0;
160155
}
161156
else
162157
{
163158
reuseLastLog = true; //Attempt to reuse previous log
164-
165-
loadSettingsPartial();
166-
if (settings.enableResetDisplay == true)
167-
{
168-
settings.resetCount++;
169-
Serial.printf("resetCount: %d\n\r", settings.resetCount);
170-
recordSystemSettings(); //Record to NVM
171-
}
159+
settings.resetCount++;
172160

173161
Serial.print("Reset reason: ");
174162
switch (esp_reset_reason())
@@ -186,6 +174,8 @@ void beginBoard()
186174
default : Serial.println("Unknown");
187175
}
188176
}
177+
178+
recordSystemSettings(); //Record resetCount to NVM
189179
}
190180

191181
void beginSD()
@@ -715,7 +705,7 @@ bool beginExternalTriggers()
715705
//Check if NEO-D9S is connected. Configure if available.
716706
void beginLBand()
717707
{
718-
if(settings.enablePointPerfectCorrections == false) return; //If user has turned off PointPerfect, skip everything
708+
if (settings.enablePointPerfectCorrections == false) return; //If user has turned off PointPerfect, skip everything
719709

720710
if (i2cLBand.begin(Wire, 0x43) == false) //Connect to the u-blox NEO-D9S using Wire port. The D9S default I2C address is 0x43 (not 0x42)
721711
{

0 commit comments

Comments
 (0)