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
//Attempt to access file system. This avoids collisions with file writing from other functions like recordSystemSettingsToFile() and F9PSerialReadTask()
238
+
if (xSemaphoreTake(xFATSemaphore, fatSemaphore_maxWait_ms) == pdPASS)
243
239
{
244
-
SdFile settingsFile; //FAT32
245
-
if (settingsFile.open(settingsFileName, O_READ) == false)
Serial.println(F("RTK Surveyor has been factory reset. Freezing. Please restart and open terminal at 115200bps."));
371
+
Serial.printf("RTK %s has been factory reset via settings file. Freezing. Please restart and open terminal at 115200bps.\n\r", platformBluetoothPrefix);
Copy file name to clipboardExpand all lines: Firmware/RTK_Surveyor/System.ino
+11-5Lines changed: 11 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -623,13 +623,19 @@ bool createTestFile()
623
623
SdFile testFile;
624
624
char testFileName[40] = "testfile.txt";
625
625
626
-
if (testFile.open(testFileName, O_CREAT | O_APPEND | O_WRITE) == true)
626
+
//Attempt to write to file system. This avoids collisions with file writing from other functions like recordSystemSettingsToFile() and F9PSerialReadTask()
627
+
if (xSemaphoreTake(xFATSemaphore, fatSemaphore_maxWait_ms) == pdPASS)
627
628
{
628
-
testFile.close();
629
+
if (testFile.open(testFileName, O_CREAT | O_APPEND | O_WRITE) == true)
//Attempt to write to file system. This avoids collisions with file writing from other functions like recordSystemSettingsToFile() and F9PSerialReadTask()
62
-
if (xSemaphoreTake(xFATSemaphore, fatSemaphore_maxWait) == pdPASS)
62
+
if (xSemaphoreTake(xFATSemaphore, fatSemaphore_maxWait_ms) == pdPASS)
63
63
{
64
64
Serial.println(F("Files found (date time size name):\n\r"));
65
65
sd.ls(LS_R | LS_DATE | LS_SIZE);
@@ -82,8 +82,13 @@ void menuMain()
82
82
strcpy(settingsFileName, platformFilePrefix);
83
83
strcat(settingsFileName, "_Settings.txt");
84
84
85
-
if (sd.exists(settingsFileName))
86
-
sd.remove(settingsFileName);
85
+
//Attempt to write to file system. This avoids collisions with file writing from other functions like recordSystemSettingsToFile() and F9PSerialReadTask()
86
+
if (xSemaphoreTake(xFATSemaphore, fatSemaphore_maxWait_ms) == pdPASS)
Copy file name to clipboardExpand all lines: Firmware/RTK_Surveyor/menuTest.ino
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -49,8 +49,14 @@ void menuTest()
49
49
{
50
50
if (settings.enableSD && online.microSD)
51
51
{
52
-
Serial.println(F("Files found (date time size name):\n\r"));
53
-
sd.ls(LS_R | LS_DATE | LS_SIZE);
52
+
//Attempt to access file system. This avoids collisions with file writing from other functions like recordSystemSettingsToFile() and F9PSerialReadTask()
53
+
if (xSemaphoreTake(xFATSemaphore, fatSemaphore_maxWait_ms) == pdPASS)
54
+
{
55
+
Serial.println(F("Files found (date time size name):\n\r"));
0 commit comments