From b862d16f3fc1baa5a6530012953caf13d6571509 Mon Sep 17 00:00:00 2001 From: wuyangyong Date: Thu, 31 May 2012 18:19:25 +0000 Subject: [PATCH] optimize for size. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2144 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- .../ST/STM32F0xx/Source/Templates/arm/startup_stm32f0xx.s | 4 ++-- bsp/stm32f0x/applications/application.c | 2 +- bsp/stm32f0x/applications/startup.c | 2 ++ bsp/stm32f0x/project.uvproj | 8 ++++---- bsp/stm32f0x/rtconfig.h | 6 ++---- bsp/stm32f0x/template.uvproj | 8 ++++---- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/bsp/stm32f0x/Libraries/CMSIS/ST/STM32F0xx/Source/Templates/arm/startup_stm32f0xx.s b/bsp/stm32f0x/Libraries/CMSIS/ST/STM32F0xx/Source/Templates/arm/startup_stm32f0xx.s index ac95092e7..ae507e086 100644 --- a/bsp/stm32f0x/Libraries/CMSIS/ST/STM32F0xx/Source/Templates/arm/startup_stm32f0xx.s +++ b/bsp/stm32f0x/Libraries/CMSIS/ST/STM32F0xx/Source/Templates/arm/startup_stm32f0xx.s @@ -36,7 +36,7 @@ ; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; -Stack_Size EQU 0x00000400 +Stack_Size EQU 0x00000180 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size @@ -47,7 +47,7 @@ __initial_sp ; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; -Heap_Size EQU 0x00000200 +Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base diff --git a/bsp/stm32f0x/applications/application.c b/bsp/stm32f0x/applications/application.c index 80cbffcb1..2a64276d2 100644 --- a/bsp/stm32f0x/applications/application.c +++ b/bsp/stm32f0x/applications/application.c @@ -46,7 +46,7 @@ static void rt_hw_led_init(void) } ALIGN(RT_ALIGN_SIZE) -static char led_stack[1024]; +static char led_stack[384]; static struct rt_thread led_thread; static void led_thread_entry(void* parameter) diff --git a/bsp/stm32f0x/applications/startup.c b/bsp/stm32f0x/applications/startup.c index d5b7fe2ea..81acb4013 100644 --- a/bsp/stm32f0x/applications/startup.c +++ b/bsp/stm32f0x/applications/startup.c @@ -86,8 +86,10 @@ void rtthread_startup(void) /* init scheduler system */ rt_system_scheduler_init(); +#ifdef RT_USING_DEVICE /* init all device */ rt_device_init_all(); +#endif /* init application */ rt_application_init(); diff --git a/bsp/stm32f0x/project.uvproj b/bsp/stm32f0x/project.uvproj index 3869fcfae..152e59793 100644 --- a/bsp/stm32f0x/project.uvproj +++ b/bsp/stm32f0x/project.uvproj @@ -210,13 +210,13 @@ 0 0 8 - 0 + 1 0 0 3 3 0 - 0 + 1 0 0 0 @@ -333,10 +333,10 @@ 1 - 1 + 4 0 0 - 0 + 1 0 0 0 diff --git a/bsp/stm32f0x/rtconfig.h b/bsp/stm32f0x/rtconfig.h index 925092c66..5739beea1 100644 --- a/bsp/stm32f0x/rtconfig.h +++ b/bsp/stm32f0x/rtconfig.h @@ -16,14 +16,12 @@ /* SECTION: RT_DEBUG */ /* Thread Debug */ - #define RT_DEBUG +/* #define RT_DEBUG */ /* #define RT_USING_OVERFLOW_CHECK */ /* Using Hook */ /* #define RT_USING_HOOK */ -#define IDLE_THREAD_STACK_SIZE 512 - /* Using Software Timer */ /* #define RT_USING_TIMER_SOFT */ #define RT_TIMER_THREAD_PRIO 4 @@ -59,7 +57,7 @@ /* SECTION: Device System */ /* Using Device System */ -#define RT_USING_DEVICE +/* #define RT_USING_DEVICE */ /* SECTION: Console options */ //#define RT_USING_CONSOLE diff --git a/bsp/stm32f0x/template.uvproj b/bsp/stm32f0x/template.uvproj index ceb1882e2..a77283255 100644 --- a/bsp/stm32f0x/template.uvproj +++ b/bsp/stm32f0x/template.uvproj @@ -210,13 +210,13 @@ 0 0 8 - 0 + 1 0 0 3 3 0 - 0 + 1 0 0 0 @@ -333,10 +333,10 @@ 1 - 1 + 4 0 0 - 0 + 1 0 0 0