Merge pull request #771 from TanekLiang/main_stack
[kernel] add main thread macro and rename tiny memory macro
This commit is contained in:
commit
1d701111a7
|
@ -33,6 +33,12 @@
|
||||||
#include <rthw.h>
|
#include <rthw.h>
|
||||||
#include <rtthread.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
|
#ifdef RT_USING_COMPONENTS_INIT
|
||||||
/*
|
/*
|
||||||
* Components Initialization will initialize some driver and components as following
|
* Components Initialization will initialize some driver and components as following
|
||||||
|
@ -172,7 +178,7 @@ int entry(void)
|
||||||
#ifndef RT_USING_HEAP
|
#ifndef RT_USING_HEAP
|
||||||
/* if there is not enable heap, we should use static thread and stack. */
|
/* if there is not enable heap, we should use static thread and stack. */
|
||||||
ALIGN(8)
|
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;
|
struct rt_thread main_thread;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -199,7 +205,7 @@ void rt_application_init(void)
|
||||||
|
|
||||||
#ifdef RT_USING_HEAP
|
#ifdef RT_USING_HEAP
|
||||||
tid = rt_thread_create("main", main_thread_entry, RT_NULL,
|
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);
|
RT_ASSERT(tid != RT_NULL);
|
||||||
#else
|
#else
|
||||||
rt_err_t result;
|
rt_err_t result;
|
||||||
|
|
|
@ -135,7 +135,7 @@ RTM_EXPORT(_rt_errno);
|
||||||
*/
|
*/
|
||||||
void *rt_memset(void *s, int c, rt_ubase_t count)
|
void *rt_memset(void *s, int c, rt_ubase_t count)
|
||||||
{
|
{
|
||||||
#ifdef RT_TINY_SIZE
|
#ifdef RT_USING_TINY_SIZE
|
||||||
char *xs = (char *)s;
|
char *xs = (char *)s;
|
||||||
|
|
||||||
while (count--)
|
while (count--)
|
||||||
|
@ -218,7 +218,7 @@ RTM_EXPORT(rt_memset);
|
||||||
*/
|
*/
|
||||||
void *rt_memcpy(void *dst, const void *src, rt_ubase_t count)
|
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;
|
char *tmp = (char *)dst, *s = (char *)src;
|
||||||
|
|
||||||
while (count--)
|
while (count--)
|
||||||
|
|
Loading…
Reference in New Issue