/*****************************************************************************
*
* File Name : main. c
*
* Description: main
*
* Copyright (c) 2014 Winner Micro Electronic Design Co. , Ltd.
* All rights reserved.
*
* Author : dave
*
* Date : 2014-6-14
*****************************************************************************/
#include "wm_include. h"
static OS_STK TaskStk1[512];
static OS_STK TaskStk2[512];
static void user_task1 (void)
{
while (1)
{
printf ("---" %s\r\n", __func__) ;
tls_os_time_delay (HZ) ;
}
}
static void user_task2 (void)
{
while (1)
{
printf ("---" %s\r\n", __func__) ;
tls_os_time_delay (HZ) ;
}
}
void UserMain (void)
{
printf ("\n user task \n") ;
tls_os_task_create (NULL, "task1",
( void (*) ) user_task1,
NULL,
(void *) TaskStk1, /* task's stack start address */
sizeof (TaskStk1) , /* task's stack size, unit: byte */
31,
0) ;
tls_os_task_create (NULL, "task2",
( void (*) ) user_task2,
NULL,
(void *) TaskStk2, /* task's stack start address */
sizeof (TaskStk2) , /* task's stack size, unit: byte */
32,
0) ;
#if DEMO_CONSOLE
CreateDemoTask () ;
#endif
//用户自己的 task
}
问题已解决, 和任务栈的大小有关,