From f07bb06437d39762376acd17daf106cd4267c042 Mon Sep 17 00:00:00 2001 From: bernard Date: Sat, 5 Apr 2014 23:40:18 +0800 Subject: [PATCH] [BSP] Remove the components initialization management. --- bsp/lpc176x/applications/application.c | 32 ++++++++++++++++++- bsp/lpc176x/applications/startup.c | 21 ++----------- bsp/lpc176x/project.uvopt | 43 +++++++++----------------- bsp/lpc176x/project.uvproj | 4 +-- 4 files changed, 50 insertions(+), 50 deletions(-) diff --git a/bsp/lpc176x/applications/application.c b/bsp/lpc176x/applications/application.c index f534c7352..2e30e44e4 100644 --- a/bsp/lpc176x/applications/application.c +++ b/bsp/lpc176x/applications/application.c @@ -21,12 +21,20 @@ #ifdef RT_USING_LWIP #include +#include +extern int lwip_system_init(void); #endif + #ifdef RT_USING_DFS #include #include #endif +#ifdef RT_USING_FINSH +#include +#include +#endif + /* thread phase init */ void rt_init_thread_entry(void *parameter) { @@ -36,18 +44,40 @@ void rt_init_thread_entry(void *parameter) #ifdef RT_USING_LWIP /* register Ethernet interface device */ lpc17xx_emac_hw_init(); + + /* initialize lwip stack */ + /* register ethernetif device */ + eth_system_device_init(); + + /* initialize lwip system */ + lwip_system_init(); + rt_kprintf("TCP/IP initialized!\n"); #endif /* Filesystem Initialization */ #ifdef RT_USING_DFS rt_hw_sdcard_init(); - + + /* initialize the device file system */ + dfs_init(); + +#ifdef RT_USING_DFS_ELMFAT + /* initialize the elm chan FatFS file system*/ + elm_init(); +#endif + /* mount sd card fat partition 1 as root directory */ if (dfs_mount("sd0", "/", "elm", 0, 0) == 0) rt_kprintf("File System initialized!\n"); else rt_kprintf("File System init failed!\n"); #endif + +#ifdef RT_USING_FINSH + /* initialize finsh */ + finsh_system_init(); + finsh_set_device(RT_CONSOLE_DEVICE_NAME); +#endif } int rt_application_init() diff --git a/bsp/lpc176x/applications/startup.c b/bsp/lpc176x/applications/startup.c index f332155b1..9c0829456 100644 --- a/bsp/lpc176x/applications/startup.c +++ b/bsp/lpc176x/applications/startup.c @@ -16,20 +16,13 @@ #include #include -#include "LPC17xx.h" -#include "board.h" - -#ifdef RT_USING_DFS -#include "sd.h" -#endif - /** - * @addtogroup LPC17 + * @addtogroup LPC176x */ /*@{*/ - -extern int rt_application_init(void); +#include +extern int rt_application_init(void); #ifdef __CC_ARM extern int Image$$RW_IRAM1$$ZI$$Limit; @@ -84,14 +77,6 @@ void rtthread_startup(void) /* initialize scheduler system */ rt_system_scheduler_init(); -#ifdef RT_USING_DEVICE -#ifdef RT_USING_DFS - rt_hw_sdcard_init(); -#endif - /* initialize all device */ - rt_device_init_all(); -#endif - /* initialize application */ rt_application_init(); diff --git a/bsp/lpc176x/project.uvopt b/bsp/lpc176x/project.uvopt index e2eb07d80..f9320dace 100644 --- a/bsp/lpc176x/project.uvopt +++ b/bsp/lpc176x/project.uvopt @@ -43,7 +43,7 @@ 79 66 8 - .\obj\ + .\build\ 1 @@ -71,7 +71,7 @@ 0 - 1 + 0 0 1 @@ -120,21 +120,6 @@ Segger\JL2CM3.dll - - 0 - DLGTARM - (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)(350=-1,-1,-1,-1,0)(250=-1,-1,-1,-1,0)(270=-1,-1,-1,-1,0)(313=-1,-1,-1,-1,0)(291=-1,-1,-1,-1,0)(302=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(113=-1,-1,-1,-1,0)(320=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(330=-1,-1,-1,-1,0)(332=-1,-1,-1,-1,0)(333=-1,-1,-1,-1,0)(334=-1,-1,-1,-1,0)(335=-1,-1,-1,-1,0)(336=-1,-1,-1,-1,0)(345=-1,-1,-1,-1,0)(346=-1,-1,-1,-1,0)(381=-1,-1,-1,-1,0)(382=-1,-1,-1,-1,0)(383=-1,-1,-1,-1,0)(384=-1,-1,-1,-1,0)(197=-1,-1,-1,-1,0)(198=-1,-1,-1,-1,0)(191=-1,-1,-1,-1,0)(192=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(261=-1,-1,-1,-1,0)(262=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(121=-1,-1,-1,-1,0)(122=-1,-1,-1,-1,0)(123=-1,-1,-1,-1,0)(124=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(142=-1,-1,-1,-1,0)(150=-1,-1,-1,-1,0)(400=-1,-1,-1,-1,0)(370=-1,-1,-1,-1,0)(160=-1,-1,-1,-1,0)(280=-1,-1,-1,-1,0)(240=-1,-1,-1,-1,0) - - - 0 - ARMDBGFLAGS - - - - 0 - DLGUARM - - 0 JL2CM3 @@ -158,7 +143,7 @@ 0 0 0 - 1 + 0 0 0 0 @@ -211,8 +196,8 @@ 0 0 0 - 117 - 123 + 0 + 0 0 CMSIS\CM3\DeviceSupport\NXP\LPC17xx\startup\arm\startup_LPC17xx.s startup_LPC17xx.s @@ -223,7 +208,7 @@ Applications - 1 + 0 0 0 0 @@ -233,10 +218,10 @@ 1 0 0 - 0 + 33 0 - 10 - 64 + 46 + 57 0 applications\application.c application.c @@ -265,10 +250,10 @@ 1 0 0 - 0 + 18 0 - 91 - 115 + 19 + 24 0 applications\startup.c startup.c @@ -411,8 +396,8 @@ 0 0 0 - 63 - 69 + 0 + 0 0 ..\..\src\idle.c idle.c diff --git a/bsp/lpc176x/project.uvproj b/bsp/lpc176x/project.uvproj index c9144e483..b9c21cf44 100644 --- a/bsp/lpc176x/project.uvproj +++ b/bsp/lpc176x/project.uvproj @@ -44,14 +44,14 @@ 0 1 - .\obj\ + .\build\ rtthread-lpc 1 0 0 1 1 - .\obj\ + .\build\ 1 0 0 -- GitLab