mirror of https://github.com/ARMmbed/mbed-os.git
FAT: Fixed volume count check when formatted without MBR
This saves 64 blocks (32KB when used with 512B blocks) and drops the minimum storage size from 64KB to 32KB.pull/3936/head
parent
3f92a15960
commit
3ee77e36f7
|
@ -4123,7 +4123,7 @@ FRESULT f_mkfs (
|
|||
n_vol = LD_DWORD(tbl + 12); /* Volume size */
|
||||
} else {
|
||||
/* Create a partition in this function */
|
||||
if (disk_ioctl(pdrv, GET_SECTOR_COUNT, &n_vol) != RES_OK || n_vol < 128)
|
||||
if (disk_ioctl(pdrv, GET_SECTOR_COUNT, &n_vol) != RES_OK || n_vol < ((sfd) ? 64 : 128))
|
||||
return FR_DISK_ERR;
|
||||
b_vol = (sfd) ? 0 : 63; /* Volume start sector */
|
||||
n_vol -= b_vol; /* Volume size */
|
||||
|
|
Loading…
Reference in New Issue