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
Change semaphore name from xFATSemaphore to sdCardSemaphore
The semaphore is protecting access to the SPI controller used to access
the SD card. Any operations to the SD card need to be protected by this
semaphore.
//Attempt to access file system. This avoids collisions with file writing from other functions like recordSystemSettingsToFile() and F9PSerialReadTask()
229
-
if (xSemaphoreTake(xFATSemaphore, fatSemaphore_longWait_ms) == pdPASS)
229
+
if (xSemaphoreTake(sdCardSemaphore, fatSemaphore_longWait_ms) == pdPASS)
230
230
{
231
231
if (sd.exists(fileName))
232
232
{
233
233
SdFile settingsFile; //FAT32
234
234
if (settingsFile.open(fileName, O_READ) == false)
235
235
{
236
236
Serial.println(F("Failed to open settings file"));
if (xSemaphoreTake(xFATSemaphore, fatSemaphore_shortWait_ms) == pdPASS)
591
+
if (xSemaphoreTake(sdCardSemaphore, fatSemaphore_shortWait_ms) == pdPASS)
592
592
{
593
593
if (productVariant == RTK_SURVEYOR)
594
594
digitalWrite(pin_baseStatusLED, !digitalRead(pin_baseStatusLED)); //Blink LED to indicate logging activity
@@ -604,8 +604,8 @@ void updateLogs()
604
604
updateDataFileAccess(&ubxFile); // Update the file access time & date
605
605
606
606
lastUBXLogSyncTime = millis();
607
-
xSemaphoreGive(xFATSemaphore);
608
-
} //End xFATSemaphore
607
+
xSemaphoreGive(sdCardSemaphore);
608
+
} //End sdCardSemaphore
609
609
else
610
610
{
611
611
log_d("Semaphore failed to yield");
@@ -624,11 +624,11 @@ void updateLogs()
624
624
char nmeaMessage[82]; //Max NMEA sentence length is 82
625
625
createNMEASentence(CUSTOM_NMEA_TYPE_EVENT, nmeaMessage, eventData); //textID, buffer, text
626
626
627
-
if (xSemaphoreTake(xFATSemaphore, fatSemaphore_shortWait_ms) == pdPASS)
627
+
if (xSemaphoreTake(sdCardSemaphore, fatSemaphore_shortWait_ms) == pdPASS)
628
628
{
629
629
ubxFile.println(nmeaMessage);
630
630
631
-
xSemaphoreGive(xFATSemaphore);
631
+
xSemaphoreGive(sdCardSemaphore);
632
632
newEventToRecord = false;
633
633
}
634
634
}
@@ -639,11 +639,11 @@ void updateLogs()
639
639
long fileSize = 0;
640
640
641
641
//Attempt to access file system. This avoids collisions with file writing from other functions like recordSystemSettingsToFile() and F9PSerialReadTask()
642
-
if (xSemaphoreTake(xFATSemaphore, fatSemaphore_shortWait_ms) == pdPASS)
642
+
if (xSemaphoreTake(sdCardSemaphore, fatSemaphore_shortWait_ms) == pdPASS)
Copy file name to clipboardExpand all lines: Firmware/RTK_Surveyor/System.ino
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -556,25 +556,25 @@ bool createTestFile()
556
556
SdFile testFile;
557
557
char testFileName[40] = "testfile.txt";
558
558
559
-
if (xFATSemaphore == NULL)
559
+
if (sdCardSemaphore == NULL)
560
560
{
561
-
log_d("xFATSemaphore is Null");
561
+
log_d("sdCardSemaphore is Null");
562
562
return (false);
563
563
}
564
564
565
565
//Attempt to write to file system. This avoids collisions with file writing from other functions like recordSystemSettingsToFile() and F9PSerialReadTask()
566
-
if (xSemaphoreTake(xFATSemaphore, fatSemaphore_shortWait_ms) == pdPASS)
566
+
if (xSemaphoreTake(sdCardSemaphore, fatSemaphore_shortWait_ms) == pdPASS)
567
567
{
568
568
if (testFile.open(testFileName, O_CREAT | O_APPEND | O_WRITE) == true)
Copy file name to clipboardExpand all lines: Firmware/RTK_Surveyor/menuMain.ino
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -219,12 +219,12 @@ void factoryReset()
219
219
//Attempt to write to file system. This avoids collisions with file writing from other functions like recordSystemSettingsToFile() and F9PSerialReadTask()
220
220
if (settings.enableSD && online.microSD)
221
221
{
222
-
if (xSemaphoreTake(xFATSemaphore, fatSemaphore_longWait_ms) == pdPASS)
222
+
if (xSemaphoreTake(sdCardSemaphore, fatSemaphore_longWait_ms) == pdPASS)
223
223
{
224
224
//Remove this specific settings file. Don't remove the other profiles.
//Attempt to write to file system. This avoids collisions with file writing from other functions like recordSystemSettingsToFile() and F9PSerialReadTask()
129
-
if (xSemaphoreTake(xFATSemaphore, fatSemaphore_longWait_ms) == pdPASS)
129
+
if (xSemaphoreTake(sdCardSemaphore, fatSemaphore_longWait_ms) == pdPASS)
130
130
{
131
131
Serial.println(F("Files found (date time size name):\n\r"));
0 commit comments