Skip to content

Commit d4a83c2

Browse files
committed
Change hardcoded semaphore waits to ms.
1 parent 4706594 commit d4a83c2

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

Firmware/RTK_Surveyor/Buttons.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ void powerDown(bool displayInfo)
223223
if (online.logging == true)
224224
{
225225
//Attempt to write to file system. This avoids collisions with file writing from other functions like recordSystemSettingsToFile()
226-
if (xSemaphoreTake(xFATSemaphore, 10000) == pdPASS)
226+
//Wait up to 1000ms
227+
if (xSemaphoreTake(xFATSemaphore, 1000 / portTICK_PERIOD_MS) == pdPASS)
227228
{
228229
//Close down file system
229230
ubxFile.sync();

Firmware/RTK_Surveyor/RTK_Surveyor.ino

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ int startLogTime_minutes = 0; //Mark when we start logging so we can stop loggin
115115
SemaphoreHandle_t xFATSemaphore;
116116
const TickType_t fatSemaphore_shortWait_ms = 10 / portTICK_PERIOD_MS;
117117
const TickType_t fatSemaphore_longWait_ms = 200 / portTICK_PERIOD_MS;
118-
119-
#define sdWriteSize 512 // Write data to the SD card in blocks of 512 bytes
120118
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
121119

122120
//Connection settings to NTRIP Caster

Firmware/RTK_Surveyor/menuFirmware.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ void scanForFirmware()
5151
if (online.microSD == true)
5252
{
5353
//Attempt to access file system. This avoids collisions with file writing in F9PSerialReadTask()
54-
//Wait a long time, this is important
55-
if (xSemaphoreTake(xFATSemaphore, 10000) == pdPASS)
54+
//Wait up to 5s, this is important
55+
if (xSemaphoreTake(xFATSemaphore, 5000 / portTICK_PERIOD_MS) == pdPASS)
5656
{
5757
//Count available binaries
5858
SdFile tempFile;

Firmware/RTK_Surveyor/menuMessages.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,8 +907,8 @@ bool findLastLog(char *lastLogName)
907907
if (online.microSD == true)
908908
{
909909
//Attempt to access file system. This avoids collisions with file writing in F9PSerialReadTask()
910-
//Wait a long time, this is important
911-
if (xSemaphoreTake(xFATSemaphore, 10000) == pdPASS)
910+
//Wait up to 5s, this is important
911+
if (xSemaphoreTake(xFATSemaphore, 5000 / portTICK_PERIOD_MS) == pdPASS)
912912
{
913913
//Count available binaries
914914
SdFile tempFile;

0 commit comments

Comments
 (0)