⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 startup.c

📁 RT-Thread是发展中的下一代微内核嵌入式实时操作系统
💻 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 + -