mirror of
https://github.com/opentx/opentx.git
synced 2025-07-16 12:55:12 +03:00
[Horus] Massstorage bugfix (read cache beyond end of disk)
This commit is contained in:
parent
fcdcccf8f5
commit
d4a54b5487
1 changed files with 1 additions and 1 deletions
|
@ -102,7 +102,7 @@ DRESULT DiskCache::read(BYTE drv, BYTE * buff, DWORD sector, UINT count)
|
||||||
}
|
}
|
||||||
|
|
||||||
// if block + cache block size is beyond the end of the disk, then read it directly without using cache
|
// if block + cache block size is beyond the end of the disk, then read it directly without using cache
|
||||||
if (sector+DISK_CACHE_BLOCK_SECTORS > SDCardInfo.CardCapacity / SDCardInfo.CardBlockSize) {
|
if (sector+DISK_CACHE_BLOCK_SECTORS >= SDCardInfo.CardCapacity / SDCardInfo.CardBlockSize) {
|
||||||
TRACE_DISK_CACHE("\t\t cache would be beyond end of disk(%u)", this, (uint32_t)sector);
|
TRACE_DISK_CACHE("\t\t cache would be beyond end of disk(%u)", this, (uint32_t)sector);
|
||||||
return __disk_read(drv, buff, sector, count);
|
return __disk_read(drv, buff, sector, count);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue