Skip to content

Commit 3ee77e3

Browse files
committed
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.
1 parent 3f92a15 commit 3ee77e3

File tree

1 file changed

+1
-1
lines changed
  • features/filesystem/fat/ChaN

1 file changed

+1
-1
lines changed

features/filesystem/fat/ChaN/ff.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4123,7 +4123,7 @@ FRESULT f_mkfs (
41234123
n_vol = LD_DWORD(tbl + 12); /* Volume size */
41244124
} else {
41254125
/* Create a partition in this function */
4126-
if (disk_ioctl(pdrv, GET_SECTOR_COUNT, &n_vol) != RES_OK || n_vol < 128)
4126+
if (disk_ioctl(pdrv, GET_SECTOR_COUNT, &n_vol) != RES_OK || n_vol < ((sfd) ? 64 : 128))
41274127
return FR_DISK_ERR;
41284128
b_vol = (sfd) ? 0 : 63; /* Volume start sector */
41294129
n_vol -= b_vol; /* Volume size */

0 commit comments

Comments
 (0)