Skip to content

Commit aa031fa

Browse files
committed
Sync more often if log file size is not increasing
1 parent f7c33e0 commit aa031fa

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Firmware/RTK_Everywhere/RTK_Everywhere.ino

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ uint32_t max_idle_count = MAX_IDLE_TIME_COUNT;
944944
bool bluetoothIncomingRTCM;
945945
bool bluetoothOutgoingRTCM;
946946
bool netIncomingRTCM;
947-
bool netOutgoingRTCM;
947+
volatile bool netOutgoingRTCM;
948948
volatile bool mqttClientDataReceived; // Flag for display
949949

950950
uint16_t failedParserMessages_UBX;
@@ -1669,7 +1669,7 @@ void logUpdate()
16691669
{
16701670
// Calculate generation and write speeds every 5 seconds
16711671
uint64_t fileSizeDelta = logFileSize - lastLogSize;
1672-
systemPrintf(" - Generation rate: %0.1fkB/s", ((float)fileSizeDelta) / 5.0 / 1000.0);
1672+
systemPrintf(" - Generation rate: %0.1fkB/s", ((double)fileSizeDelta) / 5.0 / 1000.0);
16731673
}
16741674
else
16751675
{
@@ -1686,7 +1686,8 @@ void logUpdate()
16861686
}
16871687
else
16881688
{
1689-
log_d("No increase in file size");
1689+
if ((settings.enablePrintLogFileStatus) && (!inMainMenu))
1690+
systemPrintf("No increase in file size: %llu -> %llu\r\n", lastLogSize, logFileSize);
16901691
logIncreasing = false;
16911692

16921693
endSD(false, true); // alreadyHaveSemaphore, releaseSemaphore

Firmware/RTK_Everywhere/Tasks.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,8 +1693,9 @@ void handleGnssDataTask(void *e)
16931693

16941694
logFileSize = logFile->fileSize(); // Update file size
16951695

1696-
// Force file sync every 60s
1697-
if ((millis() - lastUBXLogSyncTime) > 60000)
1696+
// Force file sync every 60s - or every two seconds if the size is not increasing
1697+
if (((logFileSize == lastLogSize) && ((millis() - lastUBXLogSyncTime) > 2000))
1698+
|| ((millis() - lastUBXLogSyncTime) > 60000))
16981699
{
16991700
baseStatusLedBlink(); // Blink LED to indicate logging activity
17001701

0 commit comments

Comments
 (0)