[Taranis] Bug on SD massstorage write (on block numbers > 0xFFFF)
This commit is contained in:
@@ -148,9 +148,13 @@ int8_t STORAGE_GetCapacity (uint8_t lun, uint32_t *block_num, uint32_t *block_si
|
||||
|
||||
*block_size = 512;
|
||||
|
||||
DWORD sector_count = 0;
|
||||
if (disk_ioctl(0, GET_SECTOR_COUNT, §or_count) != RES_OK)
|
||||
return -1;
|
||||
static DWORD sector_count = 0;
|
||||
if (sector_count == 0) {
|
||||
if (disk_ioctl(0, GET_SECTOR_COUNT, §or_count) != RES_OK) {
|
||||
sector_count = 0;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
*block_num = sector_count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user