We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2e72ea9 commit 4560f49Copy full SHA for 4560f49
1 file changed
lib/oofatfs/ff.c
@@ -5704,7 +5704,11 @@ FRESULT f_mkfs (
5704
}
5705
sz_fat = (n + ss - 1) / ss; /* FAT size [sector] */
5706
sz_rsv = 1; /* Number of reserved sectors */
5707
- n_rootdir = (sz_vol <= 256)? 64 : n_rootdir; /* Shrink root dir for <= 128K device */
+ // CIRCUITPY-CHANGE: For fewer than 256 clusters (128kB filesystem),
5708
+ // shrink the root directory size from 512 entries to 128 entries. Note that
5709
+ // long filenames will use two entries. This change affects only the root directory,
5710
+ // not subdirectories
5711
+ n_rootdir = (sz_vol <= 256) ? 128 : n_rootdir;
5712
sz_dir = (DWORD)n_rootdir * SZDIRE / ss; /* Rootdir size [sector] */
5713
5714
b_fat = b_vol + sz_rsv; /* FAT base */
0 commit comments