MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_application_init

Function rt_application_init

src/components.c:209–230  ·  view source on GitHub ↗

* @brief This function will create and start the main thread, but this thread * will not run until the scheduler starts. */

Source from the content-addressed store, hash-verified

207 * will not run until the scheduler starts.
208 */
209void rt_application_init(void)
210{
211 rt_thread_t tid;
212
213#ifdef RT_USING_HEAP
214 tid = rt_thread_create("main", main_thread_entry, RT_NULL,
215 RT_MAIN_THREAD_STACK_SIZE, RT_MAIN_THREAD_PRIORITY, 20);
216 RT_ASSERT(tid != RT_NULL);
217#else
218 rt_err_t result;
219
220 tid = &main_thread;
221 result = rt_thread_init(tid, "main", main_thread_entry, RT_NULL,
222 main_thread_stack, sizeof(main_thread_stack), RT_MAIN_THREAD_PRIORITY, 20);
223 RT_ASSERT(result == RT_EOK);
224
225 /* if not define RT_USING_HEAP, using to eliminate the warning */
226 (void)result;
227#endif /* RT_USING_HEAP */
228
229 rt_thread_startup(tid);
230}
231
232/**
233 * @brief This function will call all levels of initialization functions to complete

Callers 1

rtthread_startupFunction · 0.70

Calls 3

rt_thread_createFunction · 0.85
rt_thread_initFunction · 0.85
rt_thread_startupFunction · 0.85

Tested by

no test coverage detected