学前班
最后登录1970-1-1
在线时间 小时
注册时间2013-5-24
|
楼主 |
发表于 2013-5-24 17:33:22
|
显示全部楼层
做延时了,但是只是延时1s,发送10000次的时间肯定是大于1s的啊,等延时时间到了,10ms会发生一次任务调度吧,可是没有发生啊
void Task_Start(void *p_arg)
{
INT8U err,err1;
(void)p_arg;
OSTaskCreate(Task_LED2,(void *)0,
&task_led2_stk[TASK_LED2_STK_SIZE-1], TASK_LED2_PRIO);
OSTaskNameSet(TASK_LED2_PRIO, (INT8U *)"LED2_TASK", &err);
OSTaskCreate(Task_LED3,(void *)0,
&task_led3_stk[TASK_LED3_STK_SIZE-1], TASK_LED3_PRIO);
OSTaskNameSet(TASK_LED3_PRIO,(INT8U*)"LED3_TASK",&err1);
while (1)
{
LED1( ON );
printf("\r\n this is a task_start demo \r\n");
OSTimeDlyHMSM(0, 0,1,0);
LED1( OFF);
printf("\r\n this is a task_start demo end\r\n");
OSTimeDlyHMSM(0, 0,1,0);
}
}
void Task_LED2(void *p_arg)
{
(void)p_arg;
while (1)
{
int i;
for(i=0;i<10000;i++)
{
LED2( ON );
printf("\r\n this is a task_led2 demo \r\n");
}
OSTimeDlyHMSM(0, 0,2,0);
LED2( OFF);
printf("\r\n this is a task_led2 demo end\r\n");
OSTimeDlyHMSM(0, 0,2,0);
}
void Task_LED3(void *p_arg)
{
(void)p_arg;
while (1)
{
LED3( ON );
printf("\r\n this is a task_led3 demo \r\n");
OSTimeDlyHMSM(0, 0,3,0);
LED3( OFF);
printf("\r\n this is a task_led3 demo end\r\n");
OSTimeDlyHMSM(0, 0,3,0);
}
}
|
|