rtt-f030/bsp/lpc5410x/applications/startup.c

75 lines
1.5 KiB
C
Raw Normal View History

2014-12-16 19:54:29 +08:00
/*
* 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
2014-12-16 19:54:29 +08:00
*
* Change Logs:
* Date Author Notes
* 2006-08-31 Bernard first implementation
* 2011-06-05 Bernard modify for STM32F107 version
*/
#include <rthw.h>
#include <rtthread.h>
#include "board.h"
extern int rt_application_init(void);
/**
* This function will startup RT-Thread RTOS.
*/
void rtthread_startup(void)
{
2017-07-29 15:16:09 +08:00
/* initialize board */
rt_hw_board_init();
2014-12-16 19:54:29 +08:00
2017-07-29 15:16:09 +08:00
/* show version */
rt_show_version();
2014-12-16 19:54:29 +08:00
2017-07-29 15:16:09 +08:00
/* initialize tick */
rt_system_tick_init();
2014-12-16 19:54:29 +08:00
2017-07-29 15:16:09 +08:00
/* initialize kernel object */
rt_system_object_init();
2014-12-16 19:54:29 +08:00
2017-07-29 15:16:09 +08:00
/* initialize timer system */
rt_system_timer_init();
2014-12-16 19:54:29 +08:00
/* initialize system heap */
rt_system_heap_init(HEAP_BEGIN, HEAP_END);
2017-07-29 15:16:09 +08:00
/* initialize scheduler system */
rt_system_scheduler_init();
2014-12-16 19:54:29 +08:00
2017-07-29 15:16:09 +08:00
/* initialize application */
rt_application_init();
2014-12-16 19:54:29 +08:00
/* initialize timer thread */
rt_system_timer_thread_init();
2017-07-29 15:16:09 +08:00
/* initialize idle thread */
rt_thread_idle_init();
2014-12-16 19:54:29 +08:00
2017-07-29 15:16:09 +08:00
/* start scheduler */
rt_system_scheduler_start();
2014-12-16 19:54:29 +08:00
2017-07-29 15:16:09 +08:00
/* never reach here */
return ;
2014-12-16 19:54:29 +08:00
}
int main(void)
{
2017-07-29 15:16:09 +08:00
/* disable interrupt first */
rt_hw_interrupt_disable();
2014-12-16 19:54:29 +08:00
2017-07-29 15:16:09 +08:00
/* startup RT-Thread RTOS */
rtthread_startup();
2014-12-16 19:54:29 +08:00
2017-07-29 15:16:09 +08:00
return 0;
2014-12-16 19:54:29 +08:00
}