diff options
| author | Bernard Xiong <[email protected]> | 2017-12-08 11:57:22 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2017-12-08 11:57:22 +0800 |
| commit | f74cde045ba4ba70cdefb4408496d51203209192 (patch) | |
| tree | f5837d9052c4190e211c2e48094016e9771884f0 /bsp/lpc2478 | |
| parent | 37c6eac27bbf8eb780b38419c761e95bf33424c2 (diff) | |
[BSP] fix the finsh_system_init issue in BSP
Diffstat (limited to 'bsp/lpc2478')
| -rw-r--r-- | bsp/lpc2478/applications/application.c | 12 | ||||
| -rw-r--r-- | bsp/lpc2478/applications/startup.c | 93 |
2 files changed, 50 insertions, 55 deletions
diff --git a/bsp/lpc2478/applications/application.c b/bsp/lpc2478/applications/application.c index 1f92fc7b8c..ea8d1d68a1 100644 --- a/bsp/lpc2478/applications/application.c +++ b/bsp/lpc2478/applications/application.c @@ -14,13 +14,23 @@ #include <rtthread.h> +#ifdef RT_USING_FINSH +#include <shell.h> +#include <finsh.h> +#endif + /** * @addtogroup LPC2478 */ /*@{*/ int rt_application_init() { - return 0; +#ifdef RT_USING_FINSH + /* init finsh */ + finsh_system_init(); +#endif + + return 0; } /*@}*/ diff --git a/bsp/lpc2478/applications/startup.c b/bsp/lpc2478/applications/startup.c index 33fc5c9933..c262e57149 100644 --- a/bsp/lpc2478/applications/startup.c +++ b/bsp/lpc2478/applications/startup.c @@ -10,19 +10,13 @@ * Change Logs: * Date Author Notes * 2008-12-11 xuxinming first version - * 2010-4-3 LiJin add init soft timer thread + * 2010-4-3 LiJin add init soft timer thread */ #include <rthw.h> #include <rtthread.h> -#ifdef RT_USING_FINSH -#include <finsh.h> -extern int finsh_system_init(void); -#endif - #include <LPC24xx.h> -#include <board.h> /** * @addtogroup LPC2478 @@ -30,9 +24,6 @@ extern int finsh_system_init(void); /*@{*/ extern int rt_application_init(void); -#ifdef RT_USING_DEVICE -extern rt_err_t rt_hw_serial_init(void); -#endif #ifdef __CC_ARM extern int Image$$RW_IRAM1$$ZI$$Limit; @@ -45,67 +36,61 @@ extern int __bss_end; */ void rtthread_startup(void) { - /* init hardware interrupt */ - rt_hw_interrupt_init(); - - /* init board */ - rt_hw_board_init(); - - /* init tick */ - rt_system_tick_init(); - - /* init kernel object */ - rt_system_object_init(); - - rt_show_version(); + /* init hardware interrupt */ + rt_hw_interrupt_init(); + + /* init board */ + rt_hw_board_init(); + + /* init tick */ + rt_system_tick_init(); + + /* init kernel object */ + rt_system_object_init(); - /* init timer system */ - rt_system_timer_init(); + rt_show_version(); - /* init memory system */ + /* init timer system */ + rt_system_timer_init(); + + /* init memory system */ #ifdef RT_USING_HEAP #ifdef __CC_ARM - rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)0x40010000); + rt_system_heap_init((void *)&Image$$RW_IRAM1$$ZI$$Limit, (void *)0x40010000); #else - rt_system_heap_init((void*)&__bss_end, (void*)0x40010000); + rt_system_heap_init((void *)&__bss_end, (void *)0x40010000); #endif #endif - /* init scheduler system */ - rt_system_scheduler_init(); + /* init scheduler system */ + rt_system_scheduler_init(); - /* init application */ - rt_application_init(); - -#ifdef RT_USING_FINSH - /* init finsh */ - finsh_system_init(); - finsh_set_device("uart1"); -#endif - - /* init soft timer thread */ - rt_system_timer_thread_init(); + /* init application */ + rt_application_init(); + + /* init soft timer thread */ + rt_system_timer_thread_init(); - /* init idle thread */ - rt_thread_idle_init(); + /* init idle thread */ + rt_thread_idle_init(); - /* start scheduler */ - rt_system_scheduler_start(); - - /* never reach here */ - return ; + /* start scheduler */ + rt_system_scheduler_start(); + + /* never reach here */ + return ; } #ifdef __CC_ARM int main(void) { - /* disable interrupt first */ - rt_hw_interrupt_disable(); + /* disable interrupt first */ + rt_hw_interrupt_disable(); + + /* invoke rtthread_startup */ + rtthread_startup(); - /* invoke rtthread_startup */ - rtthread_startup(); - - return 0; + return 0; } #endif |
