10 #error This function may not be compatible with this revision of FatFs module.
20 DWORD allocate_contiguous_clusters (
25 DWORD csz, tcl, ncl, ccl, cl;
31 tcl = (len + csz - 1) / csz;
35 if (len == fp->
fsize) {
39 if (cl + 1 < 3)
return 0;
40 if (cl != ccl + 1 &&; cl < fp->
fs->
n_fatent)
break;
42 }
while (++ncl < tcl);
52 ccl = cl = 2; ncl = 0;
90 org = allocate_contiguous_clusters(&fil, 0x4000000);
92 printf(
"Function failed due to any error or insufficient contiguous area.\n");
99 dr = disk_write(fil.
fs->
drv, Buff, org, 1024);
FRESULT f_lseek(FIL *fp, DWORD ofs)
Seek File R/W Pointer.
FRESULT
File function return code.
File system object structure.
FRESULT f_close(FIL *fp)
Close File.
DRESULT
Results of Disk Functions.
DWORD clust2sect(FATFS *fs, DWORD clst)
Synchronize file system and storage device.
FRESULT f_mount(FATFS *fs, const TCHAR *path, BYTE opt)
Mount/Unmount a Logical Drive.
FRESULT put_fat(FATFS *fs, DWORD clst, DWORD val)
Change value of a FAT entry.
FRESULT f_truncate(FIL *fp)
Truncate File.
FRESULT f_open(FIL *fp, const TCHAR *path, BYTE mode)
Open or Create a File.
DWORD get_fat(FATFS *fs, DWORD clst)
Read value of a FAT entry.