Use the current time to generate the log filename

Resolves #548
This commit is contained in:
Raphael Coeffic
2021-08-03 11:08:14 +02:00
parent 3cb496a477
commit 5b5ea807e1
+4 -2
View File
@@ -50,7 +50,9 @@ const char * logsOpen()
{
// Determine and set log file filename
FRESULT result;
char filename[sizeof(LOGS_PATH) + LEN_MODEL_NAME + 16]; // /LOGS/modelnamexxxxxx_2013-01-01.log
// /LOGS/modelnamexxxxxx_YYYY-MM-DD-HHMMSS.log
char filename[sizeof(LOGS_PATH) + LEN_MODEL_NAME + 18 + 4 + 1];
if (!sdMounted())
return STR_NO_SDCARD;
@@ -97,7 +99,7 @@ const char * logsOpen()
char * tmp = &filename[len];
#if defined(RTCLOCK)
tmp = strAppendDate(&filename[len]);
tmp = strAppendDate(tmp, true);
#endif
strcpy(tmp, STR_LOGS_EXT);