24#ifdef RT_USING_USER_MAIN
25#ifndef RT_MAIN_THREAD_STACK_SIZE
26#define RT_MAIN_THREAD_STACK_SIZE 2048
28#ifndef RT_MAIN_THREAD_PRIORITY
29#define RT_MAIN_THREAD_PRIORITY (RT_THREAD_PRIORITY_MAX / 3)
33#ifdef RT_USING_COMPONENTS_INIT
57static int rti_start(
void)
63static int rti_board_start(
void)
69static int rti_board_end(
void)
75static int rti_end(
void)
86void rt_components_board_init(
void)
88#ifdef RT_DEBUGING_AUTO_INIT
90 const struct rt_init_desc *desc;
91 for (desc = &__rt_init_desc_rti_board_start; desc < &__rt_init_desc_rti_board_end; desc ++)
98 volatile const init_fn_t *fn_ptr;
100 for (fn_ptr = &__rt_init_rti_board_start; fn_ptr < &__rt_init_rti_board_end; fn_ptr++)
110void rt_components_init(
void)
112#ifdef RT_DEBUGING_AUTO_INIT
114 const struct rt_init_desc *desc;
116 rt_kprintf(
"do components initialization.\n");
117 for (desc = &__rt_init_desc_rti_board_end; desc < &__rt_init_desc_rti_end; desc ++)
124 volatile const init_fn_t *fn_ptr;
126 for (fn_ptr = &__rt_init_rti_board_end; fn_ptr < &__rt_init_rti_end; fn_ptr ++)
134#ifdef RT_USING_USER_MAIN
137void rt_hw_board_init(
void);
138int rtthread_startup(
void);
140#ifdef __ARMCC_VERSION
141extern int $Super$$main(
void);
148#elif defined(__ICCARM__)
150extern void __iar_data_init3(
void);
151int __low_level_init(
void)
158#elif defined(__GNUC__)
170static rt_uint8_t main_thread_stack[RT_MAIN_THREAD_STACK_SIZE];
181static void main_thread_entry(
void *
parameter)
183 extern int main(
void);
186#ifdef RT_USING_COMPONENTS_INIT
188 rt_components_init();
192 rt_hw_secondary_cpu_up();
195#ifdef __ARMCC_VERSION
197 extern int $Super$$main(
void);
200#elif defined(__ICCARM__) || defined(__GNUC__) || defined(__TASKING__) || defined(__TI_COMPILER_VERSION__)
215 RT_MAIN_THREAD_STACK_SIZE, RT_MAIN_THREAD_PRIORITY, 20);
222 main_thread_stack,
sizeof(main_thread_stack), RT_MAIN_THREAD_PRIORITY, 20);
238int rtthread_startup(
void)
259#ifdef RT_USING_SIGNALS
261 rt_system_signal_init();
rt_hw_spinlock_t _cpus_lock
void rt_thread_defunct_init(void)
void rt_show_version(void)
This function will show the version of rt-thread rtos
void rt_application_init()
void rt_system_timer_init(void)
This function will initialize system timer
void rt_system_timer_thread_init(void)
This function will initialize system timer thread
rt_err_t rt_thread_startup(rt_thread_t thread)
This function will start a thread and put it to system ready queue.
void rt_system_scheduler_init(void)
This function will initialize the system scheduler.
void rt_system_scheduler_start(void)
This function will startup the scheduler. It will select one thread with the highest priority level,...
rt_thread_t rt_thread_create(const char *name, void(*entry)(void *parameter), void *parameter, rt_uint32_t stack_size, rt_uint8_t priority, rt_uint32_t tick)
This function will create a thread object and allocate thread object memory. and stack.
rt_err_t rt_thread_init(struct rt_thread *thread, const char *name, void(*entry)(void *parameter), void *parameter, void *stack_start, rt_uint32_t stack_size, rt_uint8_t priority, rt_uint32_t tick)
This function will initialize a thread. It's used to initialize a static thread object.
struct rt_thread * rt_thread_t
void rt_thread_idle_init(void)
This function will initialize idle thread, then start it.
rt_align(RT_ALIGN_SIZE)
This function sets a hook function to idle thread loop. When the system performs idle loop,...
#define INIT_EXPORT(fn, level)
#define rt_hw_spin_lock(lock)
#define rt_hw_local_irq_disable