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()
229
-
if (xSemaphoreTake(xFATSemaphore, fatSemaphore_longWait_ms) == pdPASS)
233
+
if (xSemaphoreTake(sdCardSemaphore, fatSemaphore_longWait_ms) == pdPASS)
230
234
{
231
235
if (sd.exists(fileName))
232
236
{
233
237
SdFile settingsFile; //FAT32
234
238
if (settingsFile.open(fileName, O_READ) == false)
235
239
{
236
240
Serial.println(F("Failed to open settings file"));
Serial.printf("sdCardSemaphore failed to yield, %s line %d\r\n", __FILE__, __LINE__);
583
591
}
584
592
}
585
593
@@ -588,7 +596,7 @@ void updateLogs()
588
596
//Force file sync every 5000ms
589
597
if (millis() - lastUBXLogSyncTime > 5000)
590
598
{
591
-
if (xSemaphoreTake(xFATSemaphore, fatSemaphore_shortWait_ms) == pdPASS)
599
+
if (xSemaphoreTake(sdCardSemaphore, fatSemaphore_shortWait_ms) == pdPASS)
592
600
{
593
601
if (productVariant == RTK_SURVEYOR)
594
602
digitalWrite(pin_baseStatusLED, !digitalRead(pin_baseStatusLED)); //Blink LED to indicate logging activity
@@ -604,11 +612,11 @@ void updateLogs()
604
612
updateDataFileAccess(&ubxFile); // Update the file access time & date
605
613
606
614
lastUBXLogSyncTime = millis();
607
-
xSemaphoreGive(xFATSemaphore);
608
-
} //End xFATSemaphore
615
+
xSemaphoreGive(sdCardSemaphore);
616
+
} //End sdCardSemaphore
609
617
else
610
618
{
611
-
log_d("Semaphore failed to yield");
619
+
Serial.printf("sdCardSemaphore failed to yield, %s line %d\r\n", __FILE__, __LINE__);
612
620
}
613
621
}
614
622
@@ -624,13 +632,17 @@ void updateLogs()
624
632
char nmeaMessage[82]; //Max NMEA sentence length is 82
625
633
createNMEASentence(CUSTOM_NMEA_TYPE_EVENT, nmeaMessage, eventData); //textID, buffer, text
626
634
627
-
if (xSemaphoreTake(xFATSemaphore, fatSemaphore_shortWait_ms) == pdPASS)
635
+
if (xSemaphoreTake(sdCardSemaphore, fatSemaphore_shortWait_ms) == pdPASS)
628
636
{
629
637
ubxFile.println(nmeaMessage);
630
638
631
-
xSemaphoreGive(xFATSemaphore);
639
+
xSemaphoreGive(sdCardSemaphore);
632
640
newEventToRecord = false;
633
641
}
642
+
else
643
+
{
644
+
Serial.printf("sdCardSemaphore failed to yield, %s line %d\r\n", __FILE__, __LINE__);
645
+
}
634
646
}
635
647
636
648
//Report file sizes to show recording is working
@@ -639,11 +651,15 @@ void updateLogs()
639
651
long fileSize = 0;
640
652
641
653
//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)
654
+
if (xSemaphoreTake(sdCardSemaphore, fatSemaphore_shortWait_ms) == pdPASS)
643
655
{
644
656
fileSize = ubxFile.fileSize();
645
657
646
-
xSemaphoreGive(xFATSemaphore);
658
+
xSemaphoreGive(sdCardSemaphore);
659
+
}
660
+
else
661
+
{
662
+
Serial.printf("sdCardSemaphore failed to yield, %s line %d\r\n", __FILE__, __LINE__);
Copy file name to clipboardExpand all lines: Firmware/RTK_Surveyor/System.ino
+9-5Lines changed: 9 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -556,25 +556,29 @@ 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)
569
569
{
570
570
testFile.close();
571
571
572
572
if (sd.exists(testFileName))
573
573
sd.remove(testFileName);
574
-
xSemaphoreGive(xFATSemaphore);
574
+
xSemaphoreGive(sdCardSemaphore);
575
575
return (true);
576
576
}
577
-
xSemaphoreGive(xFATSemaphore);
577
+
xSemaphoreGive(sdCardSemaphore);
578
+
}
579
+
else
580
+
{
581
+
Serial.printf("sdCardSemaphore failed to yield, %s line %d\r\n", __FILE__, __LINE__);
Copy file name to clipboardExpand all lines: Firmware/RTK_Surveyor/menuMain.ino
+7-3Lines changed: 7 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -219,12 +219,16 @@ 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.
225
225
sd.remove(settingsFileName);
226
-
xSemaphoreGive(xFATSemaphore);
227
-
} //End xFATSemaphore
226
+
xSemaphoreGive(sdCardSemaphore);
227
+
} //End sdCardSemaphore
228
+
else
229
+
{
230
+
Serial.printf("sdCardSemaphore failed to yield, %s line %d\r\n", __FILE__, __LINE__);
0 commit comments