Follwing table shows which function is removed by configurationoptions for the module size reduction.
下面的表顯示了通過設置配置選項哪些函數(shù)將會移除,進而減小模塊大小
Function | _FS_MINIMIZE | _FS_READONLY | _USE_STRFUNC | _USE_MKFS | _USE_FORWARD | ||
1 | 2 | 3 | 1 | 0 | 0 | 0 | |
f_mount | |||||||
f_open | |||||||
f_close | |||||||
f_read | |||||||
f_write | x | ||||||
f_sync | x | ||||||
f_lseek | x | ||||||
f_opendir | x | x | |||||
f_readdir | x | x | |||||
f_stat | x | x | x | ||||
f_getfree | x | x | x | x | |||
f_truncate | x | x | x | x | |||
f_unlink | x | x | x | x | |||
f_mkdir | x | x | x | x | |||
f_chmod | x | x | x | x | |||
f_utime | x | x | x | x | |||
f_rename | x | x | x | x | |||
f_mkfs | x | x | |||||
f_forward | x | ||||||
f_putc | x | x | |||||
f_puts | x | x | |||||
f_printf | x | x | |||||
f_gets | x |
The FatFs module supports long file name (LFN) from revision 0.07.The two different file names, SFN and LFN, of a file is transparentin the file functions except for f_readdir function. The LFNfeature requiers a certain working buffer in addition. The buffersize can be configured by _MAX_LFN corresponding to the availablememory size. The size of long file name will reach up to 255characters, so that the _MAX_LFN should be set to 255 for fullfeatured LFN operation. When the size of working buffer isinsufficient for the given file name, the file function will failwith FR_INVALID_NAME.
FatFs從0.07版本開始支持長文件名(LFN)。在調(diào)用文件函數(shù)時,一個文件的兩個文件名(SFN與LFN)是通用的,除了f_readdir函數(shù)。支持長文件特性將需要一個額外的工作緩沖區(qū),此緩沖區(qū)的大小可以通過設置_MAX_LFN來以可用的內(nèi)存大小相符。因為長文件名長達255個字符,因此_MAX_LFN應該設置為255來支持全特性的LFN選項。當工作緩沖區(qū)的大小容不下給出的文件名時文件函數(shù)就會因為FR_INVALID_NAME而調(diào)用失敗。
LFN cfg on ARM7DMI Code page ROM size [bytes]SBCS +4719932(Shift-JIS) +63755936(GBK) +178943949(Korean) +141003950(Big5) +112631
When LFN is enabled, the module size will be increased depends onthe selected code page. Right table shows the difference in modulesize between the conditions that LFN is disabled and enabled onsome code pages. We are the Japanese, Chinese and Korean have tensof thousands of characters. Unfortunately, it requires a hugeOEM-Unicode bidirectional conversion table and the module size willbe drastically increased that shown in the table. As the result,the FatFs with LFN enabled will not able to be implemented to most8-bit microcontrollers including AVR. This is the reason why I hadnot been interested in implementing the LFN feature for a long time:-)
當使能LFN,模塊增加的大小由編碼頁類型決定,右邊的表顯示了LFN禁用與使用某些編碼來使能時模塊的不同大小。日語、中文與韓國語擁有成千上萬的字詞,而不幸的是,將需要一個巨大的OEM-Unicode雙向轉換表,模塊的大小將大大的增大,如表所示。因此,使能LFN的FatFs將不能在包括AVR在內(nèi)的大多數(shù)8位微控制器上使用。這也是為什么我長期以來對實現(xiàn)LFN特性不感興趣:-).
Note that the LFN feature on the FAT file system is a patent ofMicrosoft Corporation. When enable it on the commercial products, alicense from Microsoft may be required depends on the finaldestination.
請注意:FAT文件系統(tǒng)的LFN特性是微軟公司的專利。當在商用產(chǎn)品上使用時,根據(jù)最終目的的不同可能需要獲得微軟的許可證。