ucos III 任务创建和消息,定时器调用 2013(2)
- UID
- 1029342
- 性别
- 男
|
ucos III 任务创建和消息,定时器调用 2013(2)
/*
*********************************************************************************************************
* STARTUP TASK
*
* Description : This is an example of a startup task. As mentioned in the book's text, you MUST
* initialize the ticker only once multitasking has started.
*
* Arguments : p_arg is the argument passed to 'AppTaskStart()' by 'OSTaskCreate()'.
*
* Returns : none
*
* Notes : 1) The first line of code is used to prevent a compiler warning because 'p_arg' is not
* used. The compiler should not generate any code for this statement.
*********************************************************************************************************
*/
static void AppTaskStart (void *p_arg)
{
OS_ERR err;
(void)p_arg;
BSP_Init(); /* Initialize BSP functions */
CPU_Init(); /* Initialize the uC/CPU services */
BSP_Tick_Init(); /* Start Tick Initialization */
Mem_Init(); /* Initialize Memory Management Module */
Math_Init(); /* Initialize Mathematical Module */
#if OS_CFG_STAT_TASK_EN > 0u
OSStatTaskCPUUsageInit(&err); /* Compute CPU capacity with no task running */
#endif
#ifdef CPU_CFG_INT_DIS_MEAS_EN
CPU_IntDisMeasMaxCurReset();
#endif
BSP_LED_Off(0);
#if (APP_CFG_SERIAL_EN == DEF_ENABLED)
App_SerialInit(); /* Initialize Serial Communication */
#endif
APP_TRACE_DBG(("Creating Application kernel objects\n\r"));
AppObjCreate(); /* Create Applicaiton kernel objects ???????ó??????????±ê?????à */
APP_TRACE_DBG(("Creating Application Tasks\n\r"));
AppTaskCreate(); /* Create Application tasks ???¨???ò???????? */
while (DEF_TRUE) { /* Task body, always written as an infinite loop. ???????÷?????ò??????while???·??? */
//BSP_LED_Toggle(0);
OSTimeDlyHMSM(0, 0, 0, 100,
OS_OPT_TIME_HMSM_STRICT,
&err);
}
} |
|
|
|
|
|