mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-22 11:30:01 +08:00
[DFS] add Kconfig for dfs-v2.0 (#7156)
* [DFS] add Kconfig for dfs-v2.0 * [DFS] Optimize the SConscript. * [dfs] move old dfs to dfs/dfs_v1
This commit is contained in:
+1
-1
@@ -16,7 +16,7 @@ config RT_USING_USER_MAIN
|
||||
|
||||
config RT_MAIN_THREAD_PRIORITY
|
||||
int "Set main thread priority"
|
||||
default 4 if RT_THREAD_PRIORITY_8
|
||||
default 4 if RT_THREAD_PRIORITY_8
|
||||
default 10 if RT_THREAD_PRIORITY_32
|
||||
default 85 if RT_THREAD_PRIORITY_256
|
||||
endif
|
||||
|
||||
+19
-136
@@ -1,4 +1,6 @@
|
||||
menuconfig RT_USING_DFS
|
||||
menu "DFS: device virtual file system"
|
||||
|
||||
config RT_USING_DFS
|
||||
bool "DFS: device virtual file system"
|
||||
select RT_USING_MUTEX
|
||||
default y
|
||||
@@ -14,18 +16,6 @@ if RT_USING_DFS
|
||||
bool "Using working directory"
|
||||
default y
|
||||
|
||||
config DFS_FILESYSTEMS_MAX
|
||||
int "The maximal number of mounted file system"
|
||||
default 4
|
||||
|
||||
config DFS_FILESYSTEM_TYPES_MAX
|
||||
int "The maximal number of file system type"
|
||||
default 4
|
||||
|
||||
config DFS_FD_MAX
|
||||
int "The maximal number of opened files"
|
||||
default 16
|
||||
|
||||
config RT_USING_DFS_MNTTABLE
|
||||
bool "Using mount table for file system"
|
||||
default n
|
||||
@@ -38,132 +28,25 @@ if RT_USING_DFS
|
||||
};
|
||||
The mount_table must be terminated with NULL.
|
||||
|
||||
config RT_USING_DFS_ELMFAT
|
||||
bool "Enable elm-chan fatfs"
|
||||
default n
|
||||
help
|
||||
FatFs is a generic FAT/exFAT file system module for small embedded systems.
|
||||
config DFS_FD_MAX
|
||||
int "The maximal number of opened files"
|
||||
default 16
|
||||
|
||||
if RT_USING_DFS_ELMFAT
|
||||
menu "elm-chan's FatFs, Generic FAT Filesystem Module"
|
||||
config RT_DFS_ELM_CODE_PAGE
|
||||
int "OEM code page"
|
||||
default 437
|
||||
choice
|
||||
prompt "The version of DFS"
|
||||
default RT_USING_DFS_V1
|
||||
default RT_USING_DFS_V2 if RT_USING_SMART
|
||||
|
||||
config RT_DFS_ELM_WORD_ACCESS
|
||||
bool "Using RT_DFS_ELM_WORD_ACCESS"
|
||||
default y
|
||||
config RT_USING_DFS_V1
|
||||
bool "DFS v1.0"
|
||||
|
||||
choice
|
||||
prompt "Support long file name"
|
||||
default RT_DFS_ELM_USE_LFN_3
|
||||
config RT_USING_DFS_V2
|
||||
bool "DFS v2.0"
|
||||
endchoice
|
||||
|
||||
config RT_DFS_ELM_USE_LFN_0
|
||||
bool "0: LFN disable"
|
||||
|
||||
config RT_DFS_ELM_USE_LFN_1
|
||||
bool "1: LFN with static LFN working buffer"
|
||||
|
||||
config RT_DFS_ELM_USE_LFN_2
|
||||
bool "2: LFN with dynamic LFN working buffer on the stack"
|
||||
|
||||
config RT_DFS_ELM_USE_LFN_3
|
||||
bool "3: LFN with dynamic LFN working buffer on the heap"
|
||||
endchoice
|
||||
|
||||
config RT_DFS_ELM_USE_LFN
|
||||
int
|
||||
default 0 if RT_DFS_ELM_USE_LFN_0
|
||||
default 1 if RT_DFS_ELM_USE_LFN_1
|
||||
default 2 if RT_DFS_ELM_USE_LFN_2
|
||||
default 3 if RT_DFS_ELM_USE_LFN_3
|
||||
|
||||
choice
|
||||
prompt "Support unicode for long file name"
|
||||
default RT_DFS_ELM_LFN_UNICODE_0
|
||||
|
||||
config RT_DFS_ELM_LFN_UNICODE_0
|
||||
bool "0: ANSI/OEM in current CP (TCHAR = char)"
|
||||
|
||||
config RT_DFS_ELM_LFN_UNICODE_1
|
||||
bool "1: Unicode in UTF-16 (TCHAR = WCHAR)"
|
||||
|
||||
config RT_DFS_ELM_LFN_UNICODE_2
|
||||
bool "2: Unicode in UTF-8 (TCHAR = char)"
|
||||
|
||||
config RT_DFS_ELM_LFN_UNICODE_3
|
||||
bool "3: Unicode in UTF-32 (TCHAR = DWORD)"
|
||||
endchoice
|
||||
|
||||
config RT_DFS_ELM_LFN_UNICODE
|
||||
int
|
||||
default 0 if RT_DFS_ELM_LFN_UNICODE_0
|
||||
default 1 if RT_DFS_ELM_LFN_UNICODE_1
|
||||
default 2 if RT_DFS_ELM_LFN_UNICODE_2
|
||||
default 3 if RT_DFS_ELM_LFN_UNICODE_3
|
||||
|
||||
config RT_DFS_ELM_MAX_LFN
|
||||
int "Maximal size of file name length"
|
||||
range 12 255
|
||||
default 255
|
||||
|
||||
config RT_DFS_ELM_DRIVES
|
||||
int "Number of volumes (logical drives) to be used."
|
||||
default 2
|
||||
|
||||
config RT_DFS_ELM_MAX_SECTOR_SIZE
|
||||
int "Maximum sector size to be handled."
|
||||
default 512
|
||||
help
|
||||
If you use some spi nor flash for fatfs, please set this the erase sector size, for example 4096.
|
||||
|
||||
config RT_DFS_ELM_USE_ERASE
|
||||
bool "Enable sector erase feature"
|
||||
default n
|
||||
|
||||
config RT_DFS_ELM_REENTRANT
|
||||
bool "Enable the reentrancy (thread safe) of the FatFs module"
|
||||
default y
|
||||
|
||||
config RT_DFS_ELM_MUTEX_TIMEOUT
|
||||
int "Timeout of thread-safe protection mutex"
|
||||
range 0 1000000
|
||||
default 3000
|
||||
depends on RT_DFS_ELM_REENTRANT
|
||||
endmenu
|
||||
endif
|
||||
|
||||
config RT_USING_DFS_DEVFS
|
||||
bool "Using devfs for device objects"
|
||||
default y
|
||||
|
||||
config RT_USING_DFS_ROMFS
|
||||
bool "Enable ReadOnly file system on flash"
|
||||
default n
|
||||
|
||||
config RT_USING_DFS_CROMFS
|
||||
bool "Enable ReadOnly compressed file system on flash"
|
||||
default n
|
||||
# select PKG_USING_ZLIB
|
||||
|
||||
config RT_USING_DFS_RAMFS
|
||||
bool "Enable RAM file system"
|
||||
select RT_USING_MEMHEAP
|
||||
default n
|
||||
|
||||
config RT_USING_DFS_TMPFS
|
||||
bool "Enable TMP file system"
|
||||
default n
|
||||
|
||||
config RT_USING_DFS_NFS
|
||||
bool "Using NFS v3 client file system"
|
||||
depends on RT_USING_LWIP
|
||||
default n
|
||||
|
||||
if RT_USING_DFS_NFS
|
||||
config RT_NFS_HOST_EXPORT
|
||||
string "NFSv3 host export"
|
||||
default "192.168.1.5:/"
|
||||
endif
|
||||
source "$RTT_DIR/components/dfs/dfs_v1/Kconfig"
|
||||
source "$RTT_DIR/components/dfs/dfs_v2/Kconfig"
|
||||
|
||||
endif
|
||||
|
||||
endmenu
|
||||
|
||||
+10
-21
@@ -1,26 +1,15 @@
|
||||
from building import *
|
||||
# RT-Thread building script for bridge
|
||||
|
||||
import os
|
||||
from building import *
|
||||
|
||||
# The set of source files associated with this SConscript file.
|
||||
src = Split('''
|
||||
src/dfs.c
|
||||
src/dfs_file.c
|
||||
src/dfs_fs.c
|
||||
''')
|
||||
cwd = GetCurrentDir()
|
||||
CPPPATH = [cwd + "/include"]
|
||||
objs = []
|
||||
list = os.listdir(cwd)
|
||||
|
||||
if GetDepend('DFS_USING_POSIX'):
|
||||
src += ['src/dfs_posix.c']
|
||||
for d in list:
|
||||
path = os.path.join(cwd, d)
|
||||
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||
objs = objs + SConscript(os.path.join(d, 'SConscript'))
|
||||
|
||||
group = DefineGroup('Filesystem', src, depend = ['RT_USING_DFS'], CPPPATH = CPPPATH)
|
||||
|
||||
if GetDepend('RT_USING_DFS'):
|
||||
# search in the file system implementation
|
||||
list = os.listdir(cwd)
|
||||
|
||||
for item in list:
|
||||
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
|
||||
group = group + SConscript(os.path.join(item, 'SConscript'))
|
||||
|
||||
Return('group')
|
||||
Return('objs')
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
if RT_USING_DFS_V1
|
||||
config DFS_FILESYSTEMS_MAX
|
||||
int "The maximal number of mounted file system"
|
||||
default 4
|
||||
|
||||
config DFS_FILESYSTEM_TYPES_MAX
|
||||
int "The maximal number of file system type"
|
||||
default 4
|
||||
|
||||
config RT_USING_DFS_ELMFAT
|
||||
bool "Enable elm-chan fatfs"
|
||||
default n
|
||||
help
|
||||
FatFs is a generic FAT/exFAT file system module for small embedded systems.
|
||||
|
||||
if RT_USING_DFS_ELMFAT
|
||||
menu "elm-chan's FatFs, Generic FAT Filesystem Module"
|
||||
config RT_DFS_ELM_CODE_PAGE
|
||||
int "OEM code page"
|
||||
default 437
|
||||
|
||||
config RT_DFS_ELM_WORD_ACCESS
|
||||
bool "Using RT_DFS_ELM_WORD_ACCESS"
|
||||
default y
|
||||
|
||||
choice
|
||||
prompt "Support long file name"
|
||||
default RT_DFS_ELM_USE_LFN_3
|
||||
|
||||
config RT_DFS_ELM_USE_LFN_0
|
||||
bool "0: LFN disable"
|
||||
|
||||
config RT_DFS_ELM_USE_LFN_1
|
||||
bool "1: LFN with static LFN working buffer"
|
||||
|
||||
config RT_DFS_ELM_USE_LFN_2
|
||||
bool "2: LFN with dynamic LFN working buffer on the stack"
|
||||
|
||||
config RT_DFS_ELM_USE_LFN_3
|
||||
bool "3: LFN with dynamic LFN working buffer on the heap"
|
||||
endchoice
|
||||
|
||||
config RT_DFS_ELM_USE_LFN
|
||||
int
|
||||
default 0 if RT_DFS_ELM_USE_LFN_0
|
||||
default 1 if RT_DFS_ELM_USE_LFN_1
|
||||
default 2 if RT_DFS_ELM_USE_LFN_2
|
||||
default 3 if RT_DFS_ELM_USE_LFN_3
|
||||
|
||||
choice
|
||||
prompt "Support unicode for long file name"
|
||||
default RT_DFS_ELM_LFN_UNICODE_0
|
||||
|
||||
config RT_DFS_ELM_LFN_UNICODE_0
|
||||
bool "0: ANSI/OEM in current CP (TCHAR = char)"
|
||||
|
||||
config RT_DFS_ELM_LFN_UNICODE_1
|
||||
bool "1: Unicode in UTF-16 (TCHAR = WCHAR)"
|
||||
|
||||
config RT_DFS_ELM_LFN_UNICODE_2
|
||||
bool "2: Unicode in UTF-8 (TCHAR = char)"
|
||||
|
||||
config RT_DFS_ELM_LFN_UNICODE_3
|
||||
bool "3: Unicode in UTF-32 (TCHAR = DWORD)"
|
||||
endchoice
|
||||
|
||||
config RT_DFS_ELM_LFN_UNICODE
|
||||
int
|
||||
default 0 if RT_DFS_ELM_LFN_UNICODE_0
|
||||
default 1 if RT_DFS_ELM_LFN_UNICODE_1
|
||||
default 2 if RT_DFS_ELM_LFN_UNICODE_2
|
||||
default 3 if RT_DFS_ELM_LFN_UNICODE_3
|
||||
|
||||
config RT_DFS_ELM_MAX_LFN
|
||||
int "Maximal size of file name length"
|
||||
range 12 255
|
||||
default 255
|
||||
|
||||
config RT_DFS_ELM_DRIVES
|
||||
int "Number of volumes (logical drives) to be used."
|
||||
default 2
|
||||
|
||||
config RT_DFS_ELM_MAX_SECTOR_SIZE
|
||||
int "Maximum sector size to be handled."
|
||||
default 512
|
||||
help
|
||||
If you use some spi nor flash for fatfs, please set this the erase sector size, for example 4096.
|
||||
|
||||
config RT_DFS_ELM_USE_ERASE
|
||||
bool "Enable sector erase feature"
|
||||
default n
|
||||
|
||||
config RT_DFS_ELM_REENTRANT
|
||||
bool "Enable the reentrancy (thread safe) of the FatFs module"
|
||||
default y
|
||||
|
||||
config RT_DFS_ELM_MUTEX_TIMEOUT
|
||||
int "Timeout of thread-safe protection mutex"
|
||||
range 0 1000000
|
||||
default 3000
|
||||
depends on RT_DFS_ELM_REENTRANT
|
||||
endmenu
|
||||
endif
|
||||
|
||||
config RT_USING_DFS_DEVFS
|
||||
bool "Using devfs for device objects"
|
||||
default y
|
||||
|
||||
config RT_USING_DFS_ROMFS
|
||||
bool "Enable ReadOnly file system on flash"
|
||||
default n
|
||||
|
||||
config RT_USING_DFS_CROMFS
|
||||
bool "Enable ReadOnly compressed file system on flash"
|
||||
default n
|
||||
# select PKG_USING_ZLIB
|
||||
|
||||
config RT_USING_DFS_RAMFS
|
||||
bool "Enable RAM file system"
|
||||
select RT_USING_MEMHEAP
|
||||
default n
|
||||
|
||||
config RT_USING_DFS_TMPFS
|
||||
bool "Enable TMP file system"
|
||||
default n
|
||||
|
||||
config RT_USING_DFS_NFS
|
||||
bool "Using NFS v3 client file system"
|
||||
depends on RT_USING_LWIP
|
||||
default n
|
||||
|
||||
if RT_USING_DFS_NFS
|
||||
config RT_NFS_HOST_EXPORT
|
||||
string "NFSv3 host export"
|
||||
default "192.168.1.5:/"
|
||||
endif
|
||||
|
||||
endif
|
||||
@@ -0,0 +1,25 @@
|
||||
from building import *
|
||||
import os
|
||||
|
||||
# The set of source files associated with this SConscript file.
|
||||
src = []
|
||||
cwd = GetCurrentDir()
|
||||
CPPPATH = [cwd + "/include"]
|
||||
group = []
|
||||
|
||||
if GetDepend('RT_USING_DFS') and not GetDepend('RT_USING_DFS_V2'):
|
||||
src = ['src/dfs.c', 'src/dfs_file.c', 'src/dfs_fs.c']
|
||||
|
||||
if GetDepend('DFS_USING_POSIX'):
|
||||
src += ['src/dfs_posix.c']
|
||||
|
||||
group = DefineGroup('Filesystem', src, depend = ['RT_USING_DFS'], CPPPATH = CPPPATH)
|
||||
|
||||
# search in the file system implementation
|
||||
list = os.listdir(cwd)
|
||||
|
||||
for item in list:
|
||||
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
|
||||
group = group + SConscript(os.path.join(item, 'SConscript'))
|
||||
|
||||
Return('group')
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user