* @brief This function will create and start the main thread, but this thread * will not run until the scheduler starts. */
| 207 | * will not run until the scheduler starts. |
| 208 | */ |
| 209 | void 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 |
no test coverage detected