mirror of
https://github.com/opentx/opentx.git
synced 2025-07-14 11:59:50 +03:00
Fixed bug in Disk Cache: reads bigger than cache block size were not handled properly
This commit is contained in:
parent
e62759e5f2
commit
d2923a32d3
1 changed files with 6 additions and 0 deletions
|
@ -96,6 +96,12 @@ DRESULT DiskCache::read(BYTE drv, BYTE* buff, DWORD sector, UINT count)
|
|||
// return __disk_read(drv, buff, sector, count);
|
||||
// }
|
||||
|
||||
// if read is bigger than cache block, then read it directly without using cache
|
||||
if (count > DISK_CACHE_BLOCK_SECTORS) {
|
||||
TRACE_DISK_CACHE("\t\t big read(%u, %u)", this, (uint32_t)sector, (uint32_t)count);
|
||||
return __disk_read(drv, buff, sector, count);
|
||||
}
|
||||
|
||||
for(int n=0; n < DISK_CACHE_BLOCKS_NUM; ++n) {
|
||||
if (blocks[n].read(buff, sector, count)) {
|
||||
++stats.noHits;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue