From 1f42e27ecee6024edf18b99f8e4f21e3bc47cab2 Mon Sep 17 00:00:00 2001 From: qiuyiuestc Date: Tue, 20 Apr 2010 01:09:07 +0000 Subject: [PATCH] [mini2440]use long filename feature git-svn-id: https://rt-thread.googlecode.com/svn/trunk@655 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- bsp/mini2440/rtconfig.h | 6 ++++- bsp/mini2440/rtconfig.py | 6 +++-- components/dfs/SConscript | 5 ++++- components/dfs/filesystems/elmfat/ffconf.h | 7 +++++- include/rtthread.h | 26 +++++++++++----------- 5 files changed, 32 insertions(+), 18 deletions(-) diff --git a/bsp/mini2440/rtconfig.h b/bsp/mini2440/rtconfig.h index 040ac8f3a0..6b4d244ad3 100644 --- a/bsp/mini2440/rtconfig.h +++ b/bsp/mini2440/rtconfig.h @@ -3,7 +3,7 @@ #define __RTTHREAD_CFG_H__ /* RT_NAME_MAX*/ -#define RT_NAME_MAX 8 +#define RT_NAME_MAX 32 /* RT_ALIGN_SIZE*/ #define RT_ALIGN_SIZE 4 @@ -91,6 +91,10 @@ /* using DFS support */ #define RT_USING_DFS #define RT_USING_DFS_ELMFAT +/* use long file name feature */ +#define RT_DFS_ELM_USE_LFN 1 +/* the max number of file length */ +#define RT_DFS_ELM_MAX_LFN 32 /* #define RT_USING_DFS_YAFFS2 */ /* #define DFS_USING_WORKDIR */ diff --git a/bsp/mini2440/rtconfig.py b/bsp/mini2440/rtconfig.py index 3f2ca1660a..9e2ae60fd1 100644 --- a/bsp/mini2440/rtconfig.py +++ b/bsp/mini2440/rtconfig.py @@ -30,6 +30,8 @@ if rtconfig_ns.has_key('RT_USING_DFS'): if rtconfig_ns.has_key('RT_USING_DFS_ELMFAT'): RT_USING_DFS_ELMFAT = True + if rtconfig_ns.has_key('RT_DFS_ELM_USE_LFN'): + RT_DFS_ELM_USE_LFN = True if rtconfig_ns.has_key('RT_USING_DFS_YAFFS2'): RT_USING_DFS_YAFFS2 = True @@ -107,7 +109,7 @@ elif PLATFORM == 'armcc': LFLAGS = DEVICE + ' --strict --info sizes --info totals --info unused --info veneers --list rtthread-mini2440.map --ro-base 0x30000000 --entry Entry_Point --first Entry_Point' CFLAGS += ' -I"' + EXEC_PATH + '/ARM/RV31/INC"' - LFLAGS += ' --libpath "' + EXEC_PATH + '/ARM/RV31/LIB"' + LFLAGS += ' --libpath "' + EXEC_PATH + '/ARM/RV31/LIB"' + ' --keep __RTMsym_*' EXEC_PATH += '/arm/bin40/' @@ -134,4 +136,4 @@ elif PLATFORM == 'iar': CFLAGS = '' AFLAGS = '' - LFLAGS = '' \ No newline at end of file + LFLAGS = '' diff --git a/components/dfs/SConscript b/components/dfs/SConscript index d8511cd7f7..66186ac0be 100644 --- a/components/dfs/SConscript +++ b/components/dfs/SConscript @@ -56,10 +56,13 @@ if rtconfig.RT_USING_DFS_YAFFS2: src_local = src_local + yaffs2_main + yaffs2_comm path = path + [RTT_ROOT + '/components/dfs/filesystems/yaffs2', RTT_ROOT + '/components/dfs/filesystems/yaffs2/direct'] +if rtconfig.RT_DFS_ELM_USE_LFN: + elmfat += ['filesystems/elmfat/option/cc936.c'] + if rtconfig.RT_USING_DFS_ELMFAT: src_local = src_local + elmfat # path = path + [RTT_ROOT + '/components/dfs/filesystems/elmfat'] - + # group definitions group = {} group['name'] = 'Filesystem' diff --git a/components/dfs/filesystems/elmfat/ffconf.h b/components/dfs/filesystems/elmfat/ffconf.h index 87494d075e..7227b81c2e 100644 --- a/components/dfs/filesystems/elmfat/ffconf.h +++ b/components/dfs/filesystems/elmfat/ffconf.h @@ -84,9 +84,14 @@ / 1 - ASCII only (Valid for non LFN cfg.) */ - +#ifdef RT_DFS_ELM_USE_LFN +#define _USE_LFN RT_DFS_ELM_USE_LFN +#define _MAX_LFN RT_DFS_ELM_MAX_LFN +#else #define _USE_LFN 0 /* 0, 1 or 2 */ #define _MAX_LFN 255 /* Maximum LFN length to handle (12 to 255) */ +#endif + /* The _USE_LFN option switches the LFN support. / / 0: Disable LFN. _MAX_LFN and _LFN_UNICODE have no effect. diff --git a/include/rtthread.h b/include/rtthread.h index 152b9556e6..4ab08b6756 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -93,27 +93,27 @@ void rt_timer_timeout_sethook(void (*hook)(struct rt_timer* timer)); /* * thread interface */ -RTT_API rt_err_t rt_thread_init(struct rt_thread* thread, +rt_err_t rt_thread_init(struct rt_thread* thread, const char* name, void (*entry)(void* parameter), void* parameter, void* stack_start, rt_uint32_t stack_size, rt_uint8_t priority, rt_uint32_t tick); -RTT_API rt_err_t rt_thread_detach(rt_thread_t thread); -RTT_API rt_thread_t rt_thread_create (const char* name, +rt_err_t rt_thread_detach(rt_thread_t thread); +rt_thread_t rt_thread_create (const char* name, void (*entry)(void* parameter), void* parameter, rt_uint32_t stack_size, rt_uint8_t priority, rt_uint32_t tick); -RTT_API rt_thread_t rt_thread_self(void); -RTT_API rt_thread_t rt_thread_find(char* name); -RTT_API rt_err_t rt_thread_startup(rt_thread_t thread); -RTT_API rt_err_t rt_thread_delete(rt_thread_t thread); +rt_thread_t rt_thread_self(void); +rt_thread_t rt_thread_find(char* name); +rt_err_t rt_thread_startup(rt_thread_t thread); +rt_err_t rt_thread_delete(rt_thread_t thread); -RTT_API rt_err_t rt_thread_yield(void); -RTT_API rt_err_t rt_thread_delay(rt_tick_t tick); -RTT_API rt_err_t rt_thread_control(rt_thread_t thread, rt_uint8_t cmd, void* arg); -RTT_API rt_err_t rt_thread_suspend(rt_thread_t thread); -RTT_API rt_err_t rt_thread_resume(rt_thread_t thread); -RTT_API void rt_thread_timeout(void* parameter); +rt_err_t rt_thread_yield(void); +rt_err_t rt_thread_delay(rt_tick_t tick); +rt_err_t rt_thread_control(rt_thread_t thread, rt_uint8_t cmd, void* arg); +rt_err_t rt_thread_suspend(rt_thread_t thread); +rt_err_t rt_thread_resume(rt_thread_t thread); +void rt_thread_timeout(void* parameter); /* * idle thread interface