File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,8 @@ int startCurrentLogTime_minutes = 0; //Mark when we start this specific log file
125125// System crashes if two tasks access a file at the same time
126126// So we use a semaphore to see if file system is available
127127SemaphoreHandle_t sdCardSemaphore;
128- TickType_t fatSemaphore_shortWait_ms = 50 / portTICK_PERIOD_MS;
128+ TickType_t loggingSemaphore_shortWait_ms = 10 / portTICK_PERIOD_MS;
129+ const TickType_t fatSemaphore_shortWait_ms = 10 / portTICK_PERIOD_MS;
129130const TickType_t fatSemaphore_longWait_ms = 200 / portTICK_PERIOD_MS;
130131
131132// Display used/free space in menu and config page
Original file line number Diff line number Diff line change @@ -203,7 +203,7 @@ void F9PSerialReadTask(void *e)
203203 {
204204 // Attempt to gain access to the SD card, avoids collisions with file
205205 // writing from other functions like recordSystemSettingsToFile()
206- if (xSemaphoreTake (sdCardSemaphore, fatSemaphore_shortWait_ms ) == pdPASS)
206+ if (xSemaphoreTake (sdCardSemaphore, loggingSemaphore_shortWait_ms ) == pdPASS)
207207 {
208208 // Reduce bytes to send if we have more to send then the end of the buffer
209209 // We'll wrap next loop
@@ -240,7 +240,8 @@ void F9PSerialReadTask(void *e)
240240 // Let other tasks run, prevent watch dog timer (WDT) resets
241241 // ----------------------------------------------------------------------
242242
243- delay (10 );
243+ delay (1 );
244+ taskYIELD ();
244245 }
245246}
246247
Original file line number Diff line number Diff line change @@ -819,7 +819,7 @@ void updateLogTest()
819819 {
820820 setLogTestFrequencyMessages (rate, messages); // Set messages and rate for both UART1 and USB ports
821821
822- fatSemaphore_shortWait_ms = semaphoreWait / portTICK_PERIOD_MS; // Update variable
822+ loggingSemaphore_shortWait_ms = semaphoreWait / portTICK_PERIOD_MS; // Update variable
823823
824824 startCurrentLogTime_minutes = millis () / 1000L / 60 ; // Mark now as start of logging
825825
You can’t perform that action at this time.
0 commit comments