ucos III 任务创建和消息,定时器调用 2013(4)
- UID
- 1029342
- 性别
- 男
|
ucos III 任务创建和消息,定时器调用 2013(4)
while (DEF_TRUE) {
/* Task body, always written as an infinite loop. ???????÷?????ò??????while???·??? */
// BSP_LED_Toggle(2);
OSTimeDlyHMSM(0, 0, 0, 100,
OS_OPT_TIME_HMSM_STRICT,
&err);}
}
/*
*********************************************************************************************************
* AppObjCreate()
*
* Description : Create application kernel objects tasks.
*
* Argument(s) : none
*
* Return(s) : none
*
* Caller(s) : AppTaskStart()
*
* Note(s) : none.
*********************************************************************************************************
*/
static void AppObjCreate (void)
{
}
static void userTaskStart(void) //???????????è???????©???÷
{
OS_ERR err;
CPU_TS ts;
while(DEF_ON){ //?????????????????·?
OSSemPend( &testsem,
10,
OS_OPT_PEND_BLOCKING,
&ts,
&err );
if(err == OS_ERR_NONE)
{
// ; //???í?ó???????í
BSP_LED_Toggle(1);
}
}
}
static void userTasksem(void) //???????????è???????©???÷
{
OS_ERR err;
// BSP_LED_Toggle(3);
while(DEF_TRUE){q
BSP_LED_Toggle(4);
OSSemPost( &testsem,
OS_OPT_POST_1,
&err ) ;
if(err != OS_ERR_NONE)
{
; //???í?ó???????í
}
OSTimeDlyHMSM(0, 0, 0, 100,
OS_OPT_TIME_HMSM_STRICT,
&err);
}
}
void MYCALLBACKFUNCT(void *p_arg)
{
BSP_LED_Toggle(2);
} |
|
|
|
|
|