Skip to content

Commit 98a9ab3

Browse files
authored
Merge pull request #260 from LeeLeahy2/log-status
Enable/disable printing of log file status messages
2 parents c53e656 + b7dc1e2 commit 98a9ab3

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

Firmware/RTK_Surveyor/RTK_Surveyor.ino

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ void updateLogs()
669669
}
670670

671671
//Report file sizes to show recording is working
672-
if (millis() - lastFileReport > 5000)
672+
if ((millis() - lastFileReport) > 5000)
673673
{
674674
long fileSize = 0;
675675

@@ -690,25 +690,28 @@ void updateLogs()
690690
if (fileSize > 0)
691691
{
692692
lastFileReport = millis();
693-
Serial.printf("UBX file size: %ld", fileSize);
694-
695-
if ((systemTime_minutes - startLogTime_minutes) < settings.maxLogTime_minutes)
693+
if (settings.enablePrintLogFileStatus)
696694
{
697-
//Calculate generation and write speeds every 5 seconds
698-
uint32_t fileSizeDelta = fileSize - lastLogSize;
699-
Serial.printf(" - Generation rate: %0.1fkB/s", fileSizeDelta / 5.0 / 1000.0);
700-
701-
if (totalWriteTime > 0)
702-
Serial.printf(" - Write speed: %0.1fkB/s", fileSizeDelta / (totalWriteTime / 1000000.0) / 1000.0);
695+
Serial.printf("UBX file size: %ld", fileSize);
696+
697+
if ((systemTime_minutes - startLogTime_minutes) < settings.maxLogTime_minutes)
698+
{
699+
//Calculate generation and write speeds every 5 seconds
700+
uint32_t fileSizeDelta = fileSize - lastLogSize;
701+
Serial.printf(" - Generation rate: %0.1fkB/s", fileSizeDelta / 5.0 / 1000.0);
702+
703+
if (totalWriteTime > 0)
704+
Serial.printf(" - Write speed: %0.1fkB/s", fileSizeDelta / (totalWriteTime / 1000000.0) / 1000.0);
705+
else
706+
Serial.printf(" - Write speed: 0.0kB/s");
707+
}
703708
else
704-
Serial.printf(" - Write speed: 0.0kB/s");
705-
}
706-
else
707-
{
708-
Serial.printf(" reached max log time %d", settings.maxLogTime_minutes);
709-
}
709+
{
710+
Serial.printf(" reached max log time %d", settings.maxLogTime_minutes);
711+
}
710712

711-
Serial.println();
713+
Serial.println();
714+
}
712715

713716
totalWriteTime = 0; //Reset write time every 5s
714717

0 commit comments

Comments
 (0)