Projectkk2glider/fatfs 0.12 (#3925)
* Re #3815: Disk cache: Write statistic added. Bigger disk cache. Show disk cache misses in CLI. * Update to the latest FatFS R0.12b (all existing OpenTX patches have been already applied in upstream, only few ff.h modifications needed for simulator) * Missing file * SD card manager: do not show parent dir [..] for root directory
This commit is contained in:
committed by
Bertrand Songis
parent
eb24bbacbb
commit
4513cf89f2
+4
-10
@@ -99,7 +99,7 @@ const pm_char * logsOpen()
|
||||
|
||||
strcpy_P(tmp, STR_LOGS_EXT);
|
||||
|
||||
result = f_open(&g_oLogFile, filename, FA_OPEN_ALWAYS | FA_WRITE);
|
||||
result = f_open(&g_oLogFile, filename, FA_OPEN_ALWAYS | FA_WRITE | FA_OPEN_APPEND);
|
||||
if (result != FR_OK) {
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
@@ -107,12 +107,6 @@ const pm_char * logsOpen()
|
||||
if (f_size(&g_oLogFile) == 0) {
|
||||
writeHeader();
|
||||
}
|
||||
else {
|
||||
result = f_lseek(&g_oLogFile, f_size(&g_oLogFile)); // append
|
||||
if (result != FR_OK) {
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -123,7 +117,7 @@ void logsClose()
|
||||
{
|
||||
if (f_close(&g_oLogFile) != FR_OK) {
|
||||
// close failed, forget file
|
||||
g_oLogFile.fs = 0;
|
||||
g_oLogFile.obj.fs = 0;
|
||||
}
|
||||
lastLogTime = 0;
|
||||
}
|
||||
@@ -221,7 +215,7 @@ void logsWrite()
|
||||
if (lastLogTime == 0 || (tmr10ms_t)(tmr10ms - lastLogTime) >= (tmr10ms_t)logDelay*10) {
|
||||
lastLogTime = tmr10ms;
|
||||
|
||||
if (!g_oLogFile.fs) {
|
||||
if (!g_oLogFile.obj.fs) {
|
||||
const pm_char * result = logsOpen();
|
||||
if (result != NULL) {
|
||||
if (result != error_displayed) {
|
||||
@@ -389,7 +383,7 @@ void logsWrite()
|
||||
}
|
||||
else {
|
||||
error_displayed = NULL;
|
||||
if (g_oLogFile.fs) {
|
||||
if (g_oLogFile.obj.fs) {
|
||||
logsClose();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user