|
ucos-ii移植到stc12c5a60s2上怎么只能跑一个任务,跑第二个就不能运行。望高手指点。
[复制链接]
代码如下,高手们可以下载看看帮我指点哈。
#include"includes.h"
OS_STK TaskTest1[MaxStkSize+1];
OS_STK TaskTest2[MaxStkSize+1];
void StartTask(void *ppdata) reentrant;
void Task1(void *ppdata) reentrant;
sbit key1=P3^4;
sbit key2=P3^5;
INT8U err;
void main()
{
OSInit();
InitHardware();
OSTaskCreate(StartTask,(void *)0,&TaskTest1[0],0);
OSStart();
}
void StartTask(void *ppdata) reentrant
{
unsigned char sel,i;
ppdata=ppdata;
OSTaskCreate(Task1,(void *)0,&TaskTest2[0],1);
for(;;)
{
sel=0xfe;
for(i=0;i<8;i++)
{
P1=sel;
OSTimeDlyHMSM(0,0,1,0);
sel=_crol_(sel,1);
}
OSTimeDly(OS_TICKS_PER_SEC*2) ;
}
}
void TaskTest(void *ppdata) reentrant
{
ppdata=ppdata;
for(;;)
{
if(key1==0)P1=0xf0;
if(key2==0)P1=0x0f;
OSTimeDly(OS_TICKS_PER_SEC/2) ;
}
}
|
|