improve file format (#1446)

This commit is contained in:
Matthew Kennedy 2020-05-17 14:02:22 -07:00 committed by GitHub
parent 89ff56e844
commit 8cbddc70f6
2 changed files with 12 additions and 9 deletions

View File

@ -52,9 +52,9 @@ static int totalSyncCounter = 0;
#define LOG_INDEX_FILENAME "index.txt" #define LOG_INDEX_FILENAME "index.txt"
#define RUSEFI_LOG_PREFIX "rus" #define RUSEFI_LOG_PREFIX "rusefi_"
#define PREFIX_LEN 3 #define PREFIX_LEN 7
#define SHORT_TIME_LEN 11 #define SHORT_TIME_LEN 13
#define LS_RESPONSE "ls_result" #define LS_RESPONSE "ls_result"
#define FILE_LIST_MAX_COUNT 20 #define FILE_LIST_MAX_COUNT 20

View File

@ -86,7 +86,7 @@ static void put2(int offset, char *lcd_str, int value) {
*/ */
bool dateToStringShort(char *lcd_str) { bool dateToStringShort(char *lcd_str) {
#if EFI_RTC #if EFI_RTC
strcpy(lcd_str, "0000_000000\0"); strcpy(lcd_str, "000000_000000\0");
struct tm timp; struct tm timp;
date_get_tm(&timp); date_get_tm(&timp);
if (timp.tm_year < 116 || timp.tm_year > 130) { if (timp.tm_year < 116 || timp.tm_year > 130) {
@ -94,11 +94,14 @@ bool dateToStringShort(char *lcd_str) {
lcd_str[0] = 0; lcd_str[0] = 0;
return false; return false;
} }
put2(0, lcd_str, timp.tm_mon + 1); // months since January 0-11
put2(2, lcd_str, timp.tm_mday); // day of the month 1-31 put2(0, lcd_str, timp.tm_year % 100); // Years since 1900 - format as just the last two digits
put2(5, lcd_str, timp.tm_hour); // hours since midnight 0-23 put2(2, lcd_str, timp.tm_mon + 1); // months since January 0-11
put2(7, lcd_str, timp.tm_min); put2(4, lcd_str, timp.tm_mday); // day of the month 1-31
put2(9, lcd_str, timp.tm_sec);
put2(7, lcd_str, timp.tm_hour); // hours since midnight 0-23
put2(9, lcd_str, timp.tm_min); // Minutes
put2(11, lcd_str, timp.tm_sec); // seconds
return true; return true;
#else #else