diff options
| author | Bernard Xiong <[email protected]> | 2017-07-24 08:54:59 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-07-24 08:54:59 +0800 |
| commit | 1d701111a778844d465bc87d0a8a9d767b7bf674 (patch) | |
| tree | f94bde5f407780941b3fa37fc56eb68d2e37baef /src/components.c | |
| parent | 42042ab80d8bf31d9217353f737a307a62441ad0 (diff) | |
| parent | 2448b69d02f0378fbfde4f68dba07c3ef74e4963 (diff) | |
Merge pull request #771 from TanekLiang/main_stack
[kernel] add main thread macro and rename tiny memory macro
Diffstat (limited to 'src/components.c')
| -rw-r--r-- | src/components.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/components.c b/src/components.c index 32409924f4..fc527a97b4 100644 --- a/src/components.c +++ b/src/components.c @@ -33,6 +33,12 @@ #include <rthw.h> #include <rtthread.h> +#ifdef RT_USING_USER_MAIN +#ifndef RT_MAIN_THREAD_STACK_SIZE +#define RT_MAIN_THREAD_STACK_SIZE 512 +#endif +#endif + #ifdef RT_USING_COMPONENTS_INIT /* * Components Initialization will initialize some driver and components as following @@ -172,7 +178,7 @@ int entry(void) #ifndef RT_USING_HEAP /* if there is not enable heap, we should use static thread and stack. */ ALIGN(8) -static rt_uint8_t main_stack[2048]; +static rt_uint8_t main_stack[RT_MAIN_THREAD_STACK_SIZE]; struct rt_thread main_thread; #endif @@ -199,7 +205,7 @@ void rt_application_init(void) #ifdef RT_USING_HEAP tid = rt_thread_create("main", main_thread_entry, RT_NULL, - 2048, RT_THREAD_PRIORITY_MAX / 3, 20); + RT_MAIN_THREAD_STACK_SIZE, RT_THREAD_PRIORITY_MAX / 3, 20); RT_ASSERT(tid != RT_NULL); #else rt_err_t result; |
