auto-sync

This commit is contained in:
rusEfi 2016-08-10 01:01:43 -04:00
parent f8995ae0c2
commit c165ec74f2
2 changed files with 16 additions and 10 deletions

View File

@ -142,13 +142,13 @@ static void incLogFileName(void) {
static void prepareLogFileName(void) { static void prepareLogFileName(void) {
strcpy(logName, RUSEFI_LOG_PREFIX); strcpy(logName, RUSEFI_LOG_PREFIX);
// bool result = dateToStringShort(&logName[PREFIX_LEN]); bool result = dateToStringShort(&logName[PREFIX_LEN]);
char *ptr; char *ptr;
// if (result) { if (result) {
// ptr = &logName[PREFIX_LEN + SHORT_TIME_LEN]; ptr = &logName[PREFIX_LEN + SHORT_TIME_LEN];
// } else { } else {
ptr = itoa10(&logName[PREFIX_LEN], logFileIndex); ptr = itoa10(&logName[PREFIX_LEN], logFileIndex);
// } }
strcat(ptr, ".msl"); strcat(ptr, ".msl");
} }
@ -193,6 +193,8 @@ static void removeFile(const char *pathx) {
unlockSpi(); unlockSpi();
} }
static char lfNameBuff[100];
static void listDirectory(const char *path) { static void listDirectory(const char *path) {
if (!fs_ready) { if (!fs_ready) {
@ -215,15 +217,19 @@ static void listDirectory(const char *path) {
int i = strlen(path); int i = strlen(path);
for (int count = 0;count < FILE_LIST_MAX_COUNT;) { for (int count = 0;count < FILE_LIST_MAX_COUNT;) {
FILINFO fno; FILINFO fno;
#if _USE_LFN
fno.lfname = lfNameBuff;
fno.lfsize = sizeof(lfNameBuff);
#endif
res = f_readdir(&dir, &fno); res = f_readdir(&dir, &fno);
if (res != FR_OK || fno.fname[0] == 0) if (res != FR_OK || fno.fname[0] == 0)
break; break;
if (fno.lfname[0] == '.') if (fno.fname[0] == '.')
continue; continue;
if ((fno.fattrib & AM_DIR) || strncmp(RUSEFI_LOG_PREFIX, fno.fname, sizeof(RUSEFI_LOG_PREFIX) - 1)) { if ((fno.fattrib & AM_DIR) || strncasecmp(RUSEFI_LOG_PREFIX, fno.fname, sizeof(RUSEFI_LOG_PREFIX) - 1)) {
continue; continue;
} }
scheduleMsg(&logger, "logfile%lu:%s", fno.fsize, fno.fname); scheduleMsg(&logger, "logfile%lu:%s", fno.fsize, fno.lfname[0] == 0 ? fno.fname : fno.lfname);
count++; count++;
// scheduleMsg(&logger, "%c%c%c%c%c %u/%02u/%02u %02u:%02u %9lu %-12s", (fno.fattrib & AM_DIR) ? 'D' : '-', // scheduleMsg(&logger, "%c%c%c%c%c %u/%02u/%02u %02u:%02u %9lu %-12s", (fno.fattrib & AM_DIR) ? 'D' : '-',

View File

@ -287,7 +287,7 @@ void firmwareError(const char *errorMsg, ...) {
} }
} }
static char UNUSED_RAM_SIZE[1100]; static char UNUSED_RAM_SIZE[1000];
static char UNUSED_CCM_SIZE[8500] CCM_OPTIONAL; static char UNUSED_CCM_SIZE[8500] CCM_OPTIONAL;
@ -296,5 +296,5 @@ int getRusEfiVersion(void) {
return 123; // this is here to make the compiler happy about the unused array return 123; // this is here to make the compiler happy about the unused array
if (UNUSED_CCM_SIZE[0] * 0 != 0) if (UNUSED_CCM_SIZE[0] * 0 != 0)
return 3211; // this is here to make the compiler happy about the unused array return 3211; // this is here to make the compiler happy about the unused array
return 20160805; return 20160810;
} }