From 4dd546b5af72301784b05bd2ea7e6ffeb4475c87 Mon Sep 17 00:00:00 2001 From: batt Date: Thu, 21 May 2009 11:07:20 +0000 Subject: [PATCH] Add configuration for FatFs. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2694 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cfg/cfg_fat.h | 140 +++++++++++++++++++++++++++++++++++++++ bertos/fs/fat.h | 5 ++ bertos/fs/fatfs/src/ff.h | 1 + 3 files changed, 146 insertions(+) create mode 100644 bertos/cfg/cfg_fat.h diff --git a/bertos/cfg/cfg_fat.h b/bertos/cfg/cfg_fat.h new file mode 100644 index 00000000..d418b783 --- /dev/null +++ b/bertos/cfg/cfg_fat.h @@ -0,0 +1,140 @@ +/** + * \file + * + * + * \brief Configuration file for Fat module. + * + * \version $Id$ + * + * \author Luca Ottaviano + * \author Francesco Sacchi + */ + +#ifndef CFG_FAT_H +#define CFG_FAT_H + +/** + * Use word alignment to access FAT structure. + * $WIZ$ type = "boolean" + */ +#define CONFIG_FAT_WORD_ACCESS 0 +#define _WORD_ACCESS CONFIG_FAT_WORD_ACCESS + +/** + * Enable read functions only. + * $WIZ$ type = "boolean" + */ +#define CONFIG_FAT_FS_READONLY 0 +#define _FS_READONLY CONFIG_FAT_FS_READONLY + +/** + * Minimization level to remove some functions. + * $WIZ$ type = "int"; min = 0; max = 3 + */ +#define CONFIG_FAT_FS_MINIMIZE 0 +#define _FS_MINIMIZE CONFIG_FAT_FS_MINIMIZE + +/** + * If enabled, this reduces memory consumption 512 bytes each file object by using a shared buffer. + * $WIZ$ type = "boolean" + */ +#define CONFIG_FAT_FS_TINY 1 +#define _FS_TINY CONFIG_FAT_FS_TINY + +/** + * To enable string functions, set _USE_STRFUNC to 1 or 2. + * $WIZ$ type = "int" + * $WIZ$ supports = "False" + */ +#define CONFIG_FAT_USE_STRFUNC 0 +#define _USE_STRFUNC CONFIG_FAT_USE_STRFUNC + +/** + * Enable f_mkfs function. Requires CONFIG_FAT_FS_READONLY = 0. + * $WIZ$ type = "boolean" + */ +#define CONFIG_FAT_USE_MKFS 0 +#define _USE_MKFS (CONFIG_FAT_USE_MKFS && !CONFIG_FAT_FS_READONLY) + +/** + * Enable f_forward function. Requires CONFIG_FAT_FS_TINY. + * $WIZ$ type = "boolean" + */ +#define CONFIG_FAT_USE_FORWARD 0 +#define _USE_FORWARD (CONFIG_FAT_USE_FORWARD && CONFIG_FAT_FS_TINY) + +/** + * Number of volumes (logical drives) to be used. + * $WIZ$ type = "int"; min = 1; max = 255 + */ +#define CONFIG_FAT_DRIVES 1 +#define _DRIVES CONFIG_FAT_DRIVES + +/** + * Maximum sector size to be handled. (512/1024/2048/4096). + * 512 for memory card and hard disk, 1024 for floppy disk, 2048 for MO disk + * $WIZ$ type = "int"; min = 512; max = 4096 + */ +#define CONFIG_FAT_MAX_SS 512 +#define _MAX_SS CONFIG_FAT_MAX_SS + +/** + * When _MULTI_PARTITION is set to 0, each volume is bound to the same physical + * drive number and can mount only first primaly partition. When it is set to 1, + * each volume is tied to the partitions listed in Drives[]. + * $WIZ$ type = "boolean" + * $WIZ$ supports = "False" + */ +#define CONFIG_FAT_MULTI_PARTITION 0 +#define _MULTI_PARTITION CONFIG_FAT_MULTI_PARTITION + +/** + * Specifies the OEM code page to be used on the target system. + * $WIZ$ type = "int" + */ +#define CONFIG_FAT_CODE_PAGE 850 +#define _CODE_PAGE CONFIG_FAT_CODE_PAGE + +/** + * Support for long filenames. Enable only if you have a valid Microsoft license. + * $WIZ$ type = "boolean" + */ +#define CONFIG_FAT_USE_LFN 0 +#define _USE_LFN CONFIG_FAT_USE_LFN + +/** + * Maximum Long File Name length to handle. + * $WIZ$ type = "int"; min = 8; max = 255 + */ +#define CONFIG_FAT_MAX_LFN 255 +#define _MAX_LFN CONFIG_FAT_MAX_LFN + +#endif /* CFG_FAT_H */ diff --git a/bertos/fs/fat.h b/bertos/fs/fat.h index 77d046ee..e407c1ba 100644 --- a/bertos/fs/fat.h +++ b/bertos/fs/fat.h @@ -36,7 +36,12 @@ * * \author Luca Ottaviano * + * $WIZ$ module_name = "fat" + * $WIZ$ module_configuration = "bertos/cfg/cfg_fat.h" + * $WIZ$ module_depends = "kfile", "ff" + * */ + #ifndef FS_FAT_H #define FS_FAT_H diff --git a/bertos/fs/fatfs/src/ff.h b/bertos/fs/fatfs/src/ff.h index 8d193429..10ae4c5b 100644 --- a/bertos/fs/fatfs/src/ff.h +++ b/bertos/fs/fatfs/src/ff.h @@ -14,6 +14,7 @@ /----------------------------------------------------------------------------*/ #include "integer.h" +#include "cfg/cfg_fat.h" /*---------------------------------------------------------------------------/ / FatFs Configuration Options -- 2.25.1