diff options
| author | [email protected] <[email protected]> | 2018-07-31 17:05:01 +0800 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2018-07-31 17:05:01 +0800 |
| commit | bbb879717c2e39fabddaf3b46bb55faaf55608ef (patch) | |
| tree | dd10c1b8750989a940c52eb35be9ab8ad7e20c0d /src | |
| parent | 290eeb455b84ba06c62fcb40575e4837f677b4b5 (diff) | |
add config main thread priority
Diffstat (limited to 'src')
| -rw-r--r-- | src/components.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/components.c b/src/components.c index a73efa37b1..818e570b3c 100644 --- a/src/components.c +++ b/src/components.c @@ -37,6 +37,9 @@ #ifndef RT_MAIN_THREAD_STACK_SIZE #define RT_MAIN_THREAD_STACK_SIZE 2048 #endif +#ifndef RT_MAIN_THREAD_PRIORITY +#define RT_MAIN_THREAD_PRIORITY (RT_THREAD_PRIORITY_MAX / 3) +#endif #endif #ifdef RT_USING_COMPONENTS_INIT @@ -205,14 +208,14 @@ void rt_application_init(void) #ifdef RT_USING_HEAP tid = rt_thread_create("main", main_thread_entry, RT_NULL, - RT_MAIN_THREAD_STACK_SIZE, RT_THREAD_PRIORITY_MAX / 3, 20); + RT_MAIN_THREAD_STACK_SIZE, RT_MAIN_THREAD_PRIORITY, 20); RT_ASSERT(tid != RT_NULL); #else rt_err_t result; tid = &main_thread; result = rt_thread_init(tid, "main", main_thread_entry, RT_NULL, - main_stack, sizeof(main_stack), RT_THREAD_PRIORITY_MAX / 3, 20); + main_stack, sizeof(main_stack), RT_MAIN_THREAD_PRIORITY, 20); RT_ASSERT(result == RT_EOK); /* if not define RT_USING_HEAP, using to eliminate the warning */ |
