2013-01-08 22:40:58 +08:00
|
|
|
/*
|
2021-04-09 10:52:34 +08:00
|
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
2013-01-08 22:40:58 +08:00
|
|
|
*
|
2021-04-09 10:52:34 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2013-01-08 22:40:58 +08:00
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2010-03-30 Kyle First version
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <rtthread.h>
|
|
|
|
|
|
|
|
extern void rt_hw_board_init(void);
|
|
|
|
extern void rt_application_init(void);
|
|
|
|
|
|
|
|
#ifdef RT_USING_FINSH
|
2017-07-29 14:21:40 +08:00
|
|
|
extern int finsh_system_init(void);
|
2013-01-08 22:40:58 +08:00
|
|
|
extern void finsh_set_device(const char* device);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
#ifdef RT_USING_HEAP
|
2021-04-09 10:52:34 +08:00
|
|
|
extern void __heap_start__;
|
|
|
|
extern void __heap_end__;
|
2013-01-08 22:40:58 +08:00
|
|
|
#endif
|
|
|
|
|
2021-04-09 10:52:34 +08:00
|
|
|
rt_hw_board_init();
|
|
|
|
rt_system_timer_init();
|
2013-01-08 22:40:58 +08:00
|
|
|
|
|
|
|
#ifdef RT_USING_HEAP
|
2021-04-09 10:52:34 +08:00
|
|
|
rt_system_heap_init(&__heap_start__, &__heap_end__);
|
2013-01-08 22:40:58 +08:00
|
|
|
#endif
|
|
|
|
|
2021-04-09 10:52:34 +08:00
|
|
|
rt_system_scheduler_init();
|
|
|
|
rt_application_init();
|
2013-01-08 22:40:58 +08:00
|
|
|
|
|
|
|
#ifdef RT_USING_FINSH
|
|
|
|
/* init finsh */
|
|
|
|
finsh_system_init();
|
2022-01-03 06:51:44 +08:00
|
|
|
#if !defined(RT_USING_POSIX_STDIO) && defined(RT_USING_DEVICE)
|
2013-01-08 22:40:58 +08:00
|
|
|
finsh_set_device(FINSH_DEVICE_NAME);
|
2021-11-24 21:57:12 +08:00
|
|
|
#endif
|
2013-01-08 22:40:58 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
rt_thread_idle_init();
|
2021-04-09 10:52:34 +08:00
|
|
|
rt_system_scheduler_start();
|
2013-01-08 22:40:58 +08:00
|
|
|
|
2021-04-09 10:52:34 +08:00
|
|
|
return 0;
|
2013-01-08 22:40:58 +08:00
|
|
|
}
|