Skip to content

Commit c82f224

Browse files
committed
Reduce size of root directory because its allocated a fixed size (was 16k, now 4k). Tests show this holds ~32 files and subdirectories.
1 parent e3aaffc commit c82f224

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/fatfs/ff.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ FRESULT remove_chain (
943943
#if _USE_TRIM
944944
if (ecl + 1 == nxt) { /* Is next cluster contiguous? */
945945
ecl = nxt;
946-
} else { /* End of contiguous clusters */
946+
} else { /* End of contiguous clusters */
947947
rt[0] = clust2sect(fs, scl); /* Start sector */
948948
rt[1] = clust2sect(fs, ecl) + fs->csize - 1; /* End sector */
949949
disk_ioctl(fs->drv, CTRL_TRIM, rt); /* Erase the block */
@@ -2108,7 +2108,7 @@ int get_ldnumber ( /* Returns logical drive number (-1:invalid drive) */
21082108
for (tt = *path; (UINT)*tt >= (_USE_LFN ? ' ' : '!') && *tt != ':'; tt++) ; /* Find ':' in the path */
21092109
if (*tt == ':') { /* If a ':' is exist in the path name */
21102110
tp = *path;
2111-
i = *tp++ - '0';
2111+
i = *tp++ - '0';
21122112
if (i < 10 && tp == tt) { /* Is there a numeric drive id? */
21132113
if (i < _VOLUMES) { /* If a drive id is found, get the value and strip it */
21142114
vol = (int)i;
@@ -2141,7 +2141,7 @@ int get_ldnumber ( /* Returns logical drive number (-1:invalid drive) */
21412141
}
21422142
return vol;
21432143
}
2144-
#endif // dpgeorge: replaced with custom ff_get_ldnumber
2144+
#endif // dpgeorge: replaced with custom ff_get_ldnumber
21452145

21462146

21472147

@@ -2955,7 +2955,7 @@ FRESULT f_getcwd (
29552955
res = dir_read(&dj, 0);
29562956
if (res != FR_OK) break;
29572957
if (ccl == ld_clust(dj.fs, dj.dir)) break; /* Found the entry */
2958-
res = dir_next(&dj, 0);
2958+
res = dir_next(&dj, 0);
29592959
} while (res == FR_OK);
29602960
if (res == FR_NO_FILE) res = FR_INT_ERR;/* It cannot be 'not found'. */
29612961
if (res != FR_OK) break;
@@ -4047,7 +4047,7 @@ FRESULT f_forward (
40474047
/*-----------------------------------------------------------------------*/
40484048
/* Create file system on the logical drive */
40494049
/*-----------------------------------------------------------------------*/
4050-
#define N_ROOTDIR 512 /* Number of root directory entries for FAT12/16 */
4050+
#define N_ROOTDIR 128 /* Number of root directory entries for FAT12/16 */
40514051
#define N_FATS 1 /* Number of FATs (1 or 2) */
40524052

40534053

0 commit comments

Comments
 (0)