?? startup.c
字號:
/* * File : startup.c * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Develop Team * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rt-thread.org/license/LICENSE * * Change Logs: * Date Author Notes * 2006-08-31 Bernard first implementation */#include <rtthread.h>#include <rthw.h>#include <AT91SAM7S.h>#include "board.h"extern void rt_hw_interrupt_init(void);extern void rt_hw_board_init(void);extern void rt_serial_init(void);extern void rt_system_timer_init(void);extern void rt_system_scheduler_init(void);extern void rt_thread_idle_init(void);extern void rt_hw_cpu_icache_enable(void);/** * @addtogroup sam7x256 *//*@{*/#ifdef __GNUCC__extern unsigned char __bss_start;extern unsigned char __bss_end;#endif
void led_flash(){ int i; rt_hw_board_led_off(); for (i = 0; i < 2000000; i ++); rt_hw_board_led_on(); for (i = 0; i < 2000000; i ++);}#ifdef RT_USING_FINSHextern void finsh_system_init(void);#endifextern int rt_application_init(void);extern void rt_show_version(void);/** * This function will startup RT-Thread RTOS. */void rtthread_startup(void){ /* init hardware interrupt */ rt_hw_interrupt_init();
/* init board */ rt_hw_board_init(); /* init hardware serial */ rt_serial_init(); rt_show_version(); /* init tick */ rt_system_tick_init(); /* init kernel object */ rt_system_object_init(); /* init timer system */ rt_system_timer_init();#ifdef RT_USING_HEAP/* if the heap memory is used */ /* init memory system */ rt_system_heap_init(&__bss_end, 0x203000);#endif /* init scheduler system */ rt_system_scheduler_init();#ifdef RT_USING_HOOK /* if the hook is used */ /* set idle thread hook */ rt_thread_idle_sethook(led_flash);#endif /* init application */ rt_application_init();#ifdef RT_USING_FINSH /* if finsh is used */ /* init the finsh input */ rt_hw_finsh_init(); /* init finsh */ finsh_system_init();#endif /* init idle thread */ rt_thread_idle_init(); /* start scheduler */ rt_system_scheduler_start(); /* never reach here */ return ;}
int main (void)
{
/* invoke rtthread_startup */
rtthread_startup();
return 0;
}
/*@}*/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -