1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-14 03:49:52 +03:00

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:
Damjan Adamic 2016-10-18 18:14:17 +02:00 committed by Bertrand Songis
parent eb24bbacbb
commit 4513cf89f2
29 changed files with 8325 additions and 6636 deletions

View file

@ -86,6 +86,7 @@ DiskCache::DiskCache():
{
stats.noHits = 0;
stats.noMisses = 0;
stats.noWrites = 0;
blocks = new DiskCacheBlock[DISK_CACHE_BLOCKS_NUM];
}
@ -94,6 +95,7 @@ void DiskCache::clear()
lastBlock = 0;
stats.noHits = 0;
stats.noMisses = 0;
stats.noWrites = 0;
for (int n=0; n<DISK_CACHE_BLOCKS_NUM; ++n) {
blocks[n].free();
}
@ -147,6 +149,7 @@ DRESULT DiskCache::read(BYTE drv, BYTE * buff, DWORD sector, UINT count)
DRESULT DiskCache::write(BYTE drv, const BYTE* buff, DWORD sector, UINT count)
{
++stats.noWrites;
for(int n=0; n < DISK_CACHE_BLOCKS_NUM; ++n) {
blocks[n].free(sector, count);
}