/* Opens the log file on the Dataflash's FAT formatted partition according to the current date  */
void OpenLogFile(void)
/* Opens the log file on the Dataflash's FAT formatted partition according to the current date  */
void OpenLogFile(void)
{
	char LogFileName[16];
	TimeDate_t CurrentTimeDate;
	RTC_GetTimeDate(&CurrentTimeDate);
	snprintf(LogFileName, sizeof(LogFileName), "%02d%02d%02d.csv", CurrentTimeDate.Day, CurrentTimeDate.Month, CurrentTimeDate.Year);
	f_mount(0, &DiskFATState);
	f_open(&TempLogFile, LogFileName, FA_OPEN_ALWAYS | FA_WRITE);
	f_lseek(&TempLogFile, TempLogFile.fsize);
}