You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Firmware/RTK_Surveyor/menuMain.ino
+22-2Lines changed: 22 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -291,8 +291,28 @@ void factoryReset()
291
291
292
292
tasksStopUART2();
293
293
294
-
endSD(false, false); //Disable SD card use
295
-
294
+
//Attempt to write to file system. This avoids collisions with file writing from other functions like recordSystemSettingsToFile() and F9PSerialReadTask()
295
+
if (settings.enableSD && online.microSD)
296
+
{
297
+
if (xSemaphoreTake(sdCardSemaphore, fatSemaphore_longWait_ms) == pdPASS)
298
+
{
299
+
//Remove this specific settings file. Don't remove the other profiles.
300
+
sd->remove(settingsFileName);
301
+
302
+
sd->remove(stationCoordinateECEFFileName); //Remove station files
303
+
sd->remove(stationCoordinateGeodeticFileName);
304
+
305
+
xSemaphoreGive(sdCardSemaphore);
306
+
} //End sdCardSemaphore
307
+
else
308
+
{
309
+
//An error occurs when a settings file is on the microSD card and it is not
310
+
//deleted, as such the settings on the microSD card will be loaded when the
311
+
//RTK reboots, resulting in failure to achieve the factory reset condition
312
+
Serial.printf("sdCardSemaphore failed to yield, menuMain.ino line %d\r\n", __LINE__);
0 commit comments