ucos III 任务创建和消息,定时器调用 2013(3)
- UID
- 1029342
- 性别
- 男
|
ucos III 任务创建和消息,定时器调用 2013(3)
/*
*********************************************************************************************************
* AppTaskCreate()
*
* Description : Create application tasks.
*
* Argument(s) : none
*
* Return(s) : none
*
* Caller(s) : AppTaskStart()
*
* Note(s) : none.
*********************************************************************************************************
*/
static void AppTaskCreate (void)
{
//BSP_LED_Toggle(1);
OS_ERR err;
OSTaskCreate((OS_TCB *)&AppTaskConfigTCB, /* Create the start task */
(CPU_CHAR *)"user task Start",
(OS_TASK_PTR )userTaskStart,
(void *)0,
(OS_PRIO )APP_USER_PRIO_3,
(CPU_STK *)&AppTaskConfigStk[0],
(CPU_STK_SIZE )AppTaskStartStk[APP_CFG_TASK_START_STK_SIZE / 10],
(CPU_STK_SIZE )APP_CFG_TASK_START_STK_SIZE,
(OS_MSG_QTY )0,
(OS_TICK )0,
(void *)0,
(OS_OPT )(OS_OPT_TASK_STK_CHK | OS_OPT_TASK_STK_CLR),
(OS_ERR *)&err);
/********************check err is a must**** yj add************************************/
if(err != OS_ERR_NONE)
{
; //???í?ó???????í
}
OSTaskCreate((OS_TCB *)&AppTasktestsemTCB, /* Create the start task */
(CPU_CHAR *)"user sem Start",
(OS_TASK_PTR )userTasksem,
(void *)0,
(OS_PRIO )APP_USER_PRIO_4,
(CPU_STK *)&AppTasktestsemStk[0],
(CPU_STK_SIZE )AppTaskStartStk[APP_CFG_TASK_START_STK_SIZE / 10],
(CPU_STK_SIZE )APP_CFG_TASK_START_STK_SIZE,
(OS_MSG_QTY )0,
(OS_TICK )0,
(void *)0,
(OS_OPT )(OS_OPT_TASK_STK_CHK | OS_OPT_TASK_STK_CLR),
(OS_ERR *)&err);
/********************check err is a must**** yj add************************************/
if(err != OS_ERR_NONE)
{
; //???í?ó???????í
}
OSSemCreate( &testsem,
"my testsem",
(OS_SEM_CTR)0,
&err);
if(err != OS_ERR_NONE)
{
; //???í?ó???????í
}
OSTmrCreate((OS_TMR *)&MYTIMER1,
(CPU_CHAR *)"TIME TEST",
(OS_TICK ) 0,
(OS_TICK ) 10,
(OS_OPT ) OS_OPT_TMR_PERIODIC,
(OS_TMR_CALLBACK_PTR ) MYCALLBACKFUNCT,
(void * )0,
(OS_ERR *)&err );
OSTmrStart((OS_TMR *)&MYTIMER1,
(OS_ERR *)&err); |
|
|
|
|
|