From 9555bf29756dc3bc6cf77b61999f7bca6f7f9f87 Mon Sep 17 00:00:00 2001 From: qiuyiuestc Date: Thu, 25 Nov 2010 00:35:06 +0000 Subject: [PATCH] clean up module config file and SConscript git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1113 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- examples/module/basicapp/SConscript | 4 +- examples/module/basicapp/basicapp.c | 2 +- examples/module/extapp/SConscript | 3 +- examples/module/extapp/extapp.c | 2 +- examples/module/extension/SConscript | 2 - examples/module/rtconfig.h | 175 +-------------------------- examples/module/rtconfig.py | 98 ++++----------- examples/module/tetris/SConscript | 2 - 8 files changed, 26 insertions(+), 262 deletions(-) diff --git a/examples/module/basicapp/SConscript b/examples/module/basicapp/SConscript index d03f4ded9..b463a2f6c 100644 --- a/examples/module/basicapp/SConscript +++ b/examples/module/basicapp/SConscript @@ -25,10 +25,8 @@ src_local = Glob('basicapp.c') env.Append(CCFLAGS = group['CCFLAGS']) env.Append(CPPPATH = group['CPPPATH']) env.Append(CPPDEFINES = group['CPPDEFINES']) -module_env = env.Clone(CPPDEFINE = 'RT_MODULE') module_env = env.Clone(CCFLAGS = ' -mcpu=arm920t -O0 -fPIC') -module_env.Replace(LINK = 'arm-none-eabi-ld') -module_env.Replace(LINKFLAGS = '-z max-page-size=0x4 -shared -fPIC -e rt_application_entry -nostdlib -s') +module_env.Replace(LINKFLAGS = '-z max-page-size=0x4 -shared -fPIC -e rt_application_init -nostdlib -s') module_env.Program(target, src_local) module_env.AddPostAction(target, POST_ACTION) diff --git a/examples/module/basicapp/basicapp.c b/examples/module/basicapp/basicapp.c index b1268711f..cd251a34b 100644 --- a/examples/module/basicapp/basicapp.c +++ b/examples/module/basicapp/basicapp.c @@ -9,7 +9,7 @@ static void function(int count1, int count2, int count3) rt_kprintf("Hello RT-Thread %d %d\n", count1, count2, count3); } -int rt_application_entry(void) +int rt_application_init(void) { int i; rt_kprintf("application entry\n"); diff --git a/examples/module/extapp/SConscript b/examples/module/extapp/SConscript index a7dc25f5a..9209a640f 100644 --- a/examples/module/extapp/SConscript +++ b/examples/module/extapp/SConscript @@ -27,8 +27,7 @@ env.Append(CPPPATH = group['CPPPATH']) env.Append(CPPDEFINES = group['CPPDEFINES']) module_env = env.Clone(CPPDEFINE = 'RT_MODULE') module_env = env.Clone(CCFLAGS = ' -mcpu=arm920t -O0 -fPIC') -module_env.Replace(LINK = 'arm-none-eabi-ld') -module_env.Replace(LINKFLAGS = '-z max-page-size=0x4 -shared -fPIC -e rt_application_entry -nostdlib -s') +module_env.Replace(LINKFLAGS = '-z max-page-size=0x4 -shared -fPIC -e rt_application_init -nostdlib -s') module_env.Program(target, src_local) module_env.AddPostAction(target, POST_ACTION) diff --git a/examples/module/extapp/extapp.c b/examples/module/extapp/extapp.c index 2858766f8..5d2bbd281 100644 --- a/examples/module/extapp/extapp.c +++ b/examples/module/extapp/extapp.c @@ -3,7 +3,7 @@ typedef void (*func)(void); -int rt_application_entry(void) +int rt_application_init(void) { func f1, f2, f3, f4, f5; diff --git a/examples/module/extension/SConscript b/examples/module/extension/SConscript index 89fc7b299..d7ed70eaa 100644 --- a/examples/module/extension/SConscript +++ b/examples/module/extension/SConscript @@ -25,9 +25,7 @@ src_local = Glob('extension.c') env.Append(CCFLAGS = group['CCFLAGS']) env.Append(CPPPATH = group['CPPPATH']) env.Append(CPPDEFINES = group['CPPDEFINES']) -module_env = env.Clone(CPPDEFINE = 'RT_MODULE') module_env = env.Clone(CCFLAGS = ' -mcpu=arm920t -O0 -fPIC') -module_env.Replace(LINK = 'arm-none-eabi-ld') module_env.Replace(LINKFLAGS = '-z max-page-size=0x4 -shared -fPIC -e 0 -nostdlib -s') module_env.Program(target, src_local) module_env.AddPostAction(target, POST_ACTION) diff --git a/examples/module/rtconfig.h b/examples/module/rtconfig.h index 58416d8e9..979bf7f31 100644 --- a/examples/module/rtconfig.h +++ b/examples/module/rtconfig.h @@ -3,33 +3,11 @@ #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 -/* PRIORITY_MAX */ -#define RT_THREAD_PRIORITY_MAX 256 - -/* Tick per Second */ -#define RT_TICK_PER_SECOND 100 - -/* SECTION: RT_DEBUG */ -/* Thread Debug */ -#define RT_DEBUG -/* #define RT_THREAD_DEBUG */ - -#define RT_USING_OVERFLOW_CHECK - -/* Using Hook */ -#define RT_USING_HOOK - -/* Using Software Timer */ -#define RT_USING_TIMER_SOFT -#define RT_TIMER_THREAD_PRIO 8 -#define RT_TIMER_THREAD_STACK_SIZE 512 -#define RT_TIMER_TICK_PER_SECOND 10 - /* SECTION: IPC */ /* Using Semaphore */ #define RT_USING_SEMAPHORE @@ -50,15 +28,6 @@ /* Using Memory Pool Management*/ #define RT_USING_MEMPOOL -/* Using Dynamic Heap Management */ -#define RT_USING_HEAP - -/* Using Small MM */ -#define RT_USING_SMALL_MEM - -/* Using SLAB Allocator */ -/* #define RT_USING_SLAB */ - /* SECTION: Device System */ /* Using Device System */ #define RT_USING_DEVICE @@ -66,148 +35,6 @@ /* Using Module System */ #define RT_USING_MODULE -/* SECTION: Console options */ -/* the buffer size of console */ -#define RT_CONSOLEBUF_SIZE 128 - -/* SECTION: finsh, a C-Express shell */ -/* Using FinSH as Shell*/ -#define RT_USING_FINSH -/* Using symbol table */ -#define FINSH_USING_SYMTAB -#define FINSH_USING_DESCRIPTION -#define FINSH_THREAD_STACK_SIZE 4096 - -/* SECTION: a runtime libc library */ -/* a runtime libc library */ -/* #define RT_USING_NEWLIB */ - -/* SECTION: C++ support */ -/* Using C++ support */ -/* #define RT_USING_CPLUSPLUS */ - -/* SECTION: Device filesystem support */ -/* 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 RT_USING_DFS_NFS -#define RT_NFS_HOST_EXPORT "192.168.1.5:/" - -/* #define DFS_USING_WORKDIR */ - -/* the max number of mounted filesystem */ -#define DFS_FILESYSTEMS_MAX 2 -/* the max number of opened files */ -#define DFS_FD_MAX 16 -/* the max number of cached sector */ -#define DFS_CACHE_MAX_NUM 4 - -/* Enable freemodbus protocal stack*/ -/* #define RT_USING_MODBUS */ - -/* SECTION: lwip, a lighwight TCP/IP protocol stack */ -/* Using lighweight TCP/IP protocol stack */ -#define RT_USING_LWIP -#define RT_LWIP_DNS - -/* Trace LwIP protocol */ -/* #define RT_LWIP_DEBUG */ - -/* Enable ICMP protocol */ -#define RT_LWIP_ICMP - -/* Enable IGMP protocol */ -#define RT_LWIP_IGMP - -/* Enable UDP protocol */ -#define RT_LWIP_UDP - -/* Enable TCP protocol */ -#define RT_LWIP_TCP - -/* the number of simulatenously active TCP connections*/ -#define RT_LWIP_TCP_PCB_NUM 5 - -/* TCP sender buffer space */ -#define RT_LWIP_TCP_SND_BUF 1024*10 - -/* TCP receive window. */ -#define RT_LWIP_TCP_WND 1024 - -/* Enable SNMP protocol */ -/* #define RT_LWIP_SNMP */ - -/* Using DHCP */ -/* #define RT_LWIP_DHCP */ - -#define RT_LWIP_DNS - -/* ip address of target */ -#define RT_LWIP_IPADDR0 192 -#define RT_LWIP_IPADDR1 168 -#define RT_LWIP_IPADDR2 1 -#define RT_LWIP_IPADDR3 30 - -/* gateway address of target */ -#define RT_LWIP_GWADDR0 192 -#define RT_LWIP_GWADDR1 168 -#define RT_LWIP_GWADDR2 1 -#define RT_LWIP_GWADDR3 1 - -/* mask address of target */ -#define RT_LWIP_MSKADDR0 255 -#define RT_LWIP_MSKADDR1 255 -#define RT_LWIP_MSKADDR2 255 -#define RT_LWIP_MSKADDR3 0 - -/* the number of blocks for pbuf */ -#define RT_LWIP_PBUF_NUM 16 - -/* thread priority of tcpip thread */ -#define RT_LWIP_TCPTHREAD_PRIORITY 128 - -/* mail box size of tcpip thread to wait for */ -#define RT_LWIP_TCPTHREAD_MBOX_SIZE 32 - -/* thread stack size of tcpip thread */ -#define RT_LWIP_TCPTHREAD_STACKSIZE 4096 - -/* thread priority of ethnetif thread */ -#define RT_LWIP_ETHTHREAD_PRIORITY 144 - -/* mail box size of ethnetif thread to wait for */ -#define RT_LWIP_ETHTHREAD_MBOX_SIZE 32 - -/* thread stack size of ethnetif thread */ -#define RT_LWIP_ETHTHREAD_STACKSIZE 1024 - -/* SECTION: RTGUI support */ -/* using RTGUI support */ -#define RT_USING_RTGUI - /* name length of RTGUI object */ #define RTGUI_NAME_MAX 16 -/* support 16 weight font */ -#define RTGUI_USING_FONT16 -/* support 16 weight font */ -#define RTGUI_USING_FONT12 -/* support Chinese font */ -#define RTGUI_USING_FONTHZ -/* use DFS as file interface */ -#define RTGUI_USING_DFS_FILERW -/* use font file as Chinese font */ -/* #define RTGUI_USING_HZ_FILE */ -/* use Chinese bitmap font */ -#define RTGUI_USING_HZ_BMP -/* use small size in RTGUI */ -/* #define RTGUI_USING_SMALL_SIZE */ -/* use mouse cursor */ -/* #define RTGUI_USING_MOUSE_CURSOR */ - #endif diff --git a/examples/module/rtconfig.py b/examples/module/rtconfig.py index 2340038cf..aa6a85182 100644 --- a/examples/module/rtconfig.py +++ b/examples/module/rtconfig.py @@ -1,83 +1,27 @@ import SCons.cpp -# component options - -# toolchains options -ARCH = 'arm' -CPU = 's3c24x0' -TextBase = '0x30000000' - -CROSS_TOOL = 'gcc' - -if CROSS_TOOL == 'gcc': - PLATFORM = 'gcc' - EXEC_PATH = 'E:/Program Files/CodeSourcery/Sourcery G++ Lite/bin' -elif CROSS_TOOL == 'keil': - PLATFORM = 'armcc' - EXEC_PATH = 'E:/Keil' +EXEC_PATH = 'E:/Program Files/CodeSourcery/Sourcery G++ Lite/bin' BUILD = 'debug' -if PLATFORM == 'gcc': - # toolchains - PREFIX = 'arm-none-eabi-' - CC = PREFIX + 'gcc' - AS = PREFIX + 'gcc' - AR = PREFIX + 'ar' - LINK = PREFIX + 'gcc' - TARGET_EXT = 'axf' - SIZE = PREFIX + 'size' - OBJDUMP = PREFIX + 'objdump' - OBJCPY = PREFIX + 'objcopy' +# toolchains +PREFIX = 'arm-none-eabi-' +CC = PREFIX + 'gcc' +AS = PREFIX + 'gcc' +AR = PREFIX + 'ar' +LINK = PREFIX + 'ld' +TARGET_EXT = 'axf' +SIZE = PREFIX + 'size' +OBJDUMP = PREFIX + 'objdump' +OBJCPY = PREFIX + 'objcopy' +CFLAGS = '' +AFLAGS = '' +LFLAGS = '' - DEVICE = ' -mcpu=arm920t' - CFLAGS = DEVICE - AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp' + ' -DTEXT_BASE=' + TextBase - LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread_mini2440.map,-cref,-u,_start -T mini2440_ram.ld' + ' -Ttext ' + TextBase +CPATH = '' +LPATH = '' - CPATH = '' - LPATH = '' - - if BUILD == 'debug': - CFLAGS += ' -O0 -gdwarf-2' - AFLAGS += ' -gdwarf-2' - else: - CFLAGS += ' -O2' - - POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' - -elif PLATFORM == 'armcc': - # toolchains - CC = 'armcc' - AS = 'armasm' - AR = 'armar' - LINK = 'armlink' - TARGET_EXT = 'axf' - - DEVICE = ' --device DARMSS9' - CFLAGS = DEVICE + ' --apcs=interwork --diag_suppress=870' - AFLAGS = DEVICE - 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"' + ' --keep __RTMsym_*' - - EXEC_PATH += '/arm/bin40/' - - if BUILD == 'debug': - CFLAGS += ' -g -O0' - AFLAGS += ' -g' - else: - CFLAGS += ' -O2' - - POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET' - -elif PLATFORM == 'iar': - # toolchains - CC = 'armcc' - AS = 'armasm' - AR = 'armar' - LINK = 'armlink' - - CFLAGS = '' - AFLAGS = '' - LFLAGS = '' +if BUILD == 'debug': + CFLAGS += ' -O0 -gdwarf-2' + AFLAGS += ' -gdwarf-2' +else: + CFLAGS += ' -O2' \ No newline at end of file diff --git a/examples/module/tetris/SConscript b/examples/module/tetris/SConscript index 6806ffdef..f28c93713 100644 --- a/examples/module/tetris/SConscript +++ b/examples/module/tetris/SConscript @@ -33,9 +33,7 @@ tetris_view.c env.Append(CCFLAGS = group['CCFLAGS']) env.Append(CPPPATH = group['CPPPATH']) env.Append(CPPDEFINES = group['CPPDEFINES']) -module_env = env.Clone(CPPDEFINE = 'RT_MODULE') module_env = env.Clone(CCFLAGS = ' -mcpu=arm920t -O0 -fPIC') -module_env.Replace(LINK = 'arm-none-eabi-ld') module_env.Replace(LINKFLAGS = '-z max-page-size=0x4 -shared -fPIC -e rt_application_init -nostdlib -s') module_env.Program(target, src_local) module_env.AddPostAction(target, POST_ACTION)