Sync SD log with card at 4Hz interval

This commit is contained in:
Josh Stewart 2023-05-02 13:13:19 +10:00
parent 8d99a9c971
commit 65005c0019
3 changed files with 10 additions and 0 deletions

View File

@ -70,6 +70,7 @@ void writeSDLogEntry();
void writetSDLogHeader();
void beginSDLogging();
void endSDLogging();
void syncSDLog();
void setTS_SD_status();
void formatExFat();
void deleteLogFile(char, char, char, char);

View File

@ -445,6 +445,14 @@ void checkForSDStop()
}
void syncSDLog()
{
if( (SD_status == SD_STATUS_ACTIVE) && (!logFile.isBusy()) )
{
logFile.sync();
}
}
/**
* Will perform a complete format of the SD card to ExFAT.
* This will delete all files and create a new empty file system.

View File

@ -308,6 +308,7 @@ void loop(void)
#ifdef SD_LOGGING
if(configPage13.onboard_log_file_rate == LOGGER_RATE_4HZ) { writeSDLogEntry(); }
syncSDLog(); //Sync the SD log file to the card 4 times per second.
#endif
currentStatus.fuelPressure = getFuelPressure();