From d835d91ae8fd07fc79d33fc1a43ba2fc72b40430 Mon Sep 17 00:00:00 2001 From: tanek liang Date: Mon, 24 Jul 2017 00:23:35 +0800 Subject: [PATCH 1/2] [kernel] use the macro definition instead of the user main thread --- src/components.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components.c b/src/components.c index 32409924f..fc527a97b 100644 --- a/src/components.c +++ b/src/components.c @@ -33,6 +33,12 @@ #include #include +#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; From 2448b69d02f0378fbfde4f68dba07c3ef74e4963 Mon Sep 17 00:00:00 2001 From: tanek liang Date: Mon, 24 Jul 2017 00:28:15 +0800 Subject: [PATCH 2/2] [kernel] rename RT_TINY_SIZE to RT_USING_TINY_SIZE --- src/kservice.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kservice.c b/src/kservice.c index 6f3da8053..123c85297 100644 --- a/src/kservice.c +++ b/src/kservice.c @@ -135,7 +135,7 @@ RTM_EXPORT(_rt_errno); */ void *rt_memset(void *s, int c, rt_ubase_t count) { -#ifdef RT_TINY_SIZE +#ifdef RT_USING_TINY_SIZE char *xs = (char *)s; while (count--) @@ -218,7 +218,7 @@ RTM_EXPORT(rt_memset); */ void *rt_memcpy(void *dst, const void *src, rt_ubase_t count) { -#ifdef RT_TINY_SIZE +#ifdef RT_USING_TINY_SIZE char *tmp = (char *)dst, *s = (char *)src; while (count--)