app.c

来自「ucos II对xilinx的fx系列的power pc 405的板级支持包」· C语言 代码 · 共 107 行

C
107
字号
/***********************************************************************************************************                                                uC/OS-II*                                          The Real-Time Kernel**                                                  EX1_OS*** Description:  Shows an example of how to use uC/OS-II with the PowerPC405.  **********************************************************************************************************/#include "includes.h"
/*
*********************************************************************************************************
*                                              CONSTANTS
*********************************************************************************************************
*/

#define  LED_INTERVAL  20
/***********************************************************************************************************                                           GLOBAL VARIABLES**********************************************************************************************************/static  OS_STK   AppTaskFirstStk [APP_TASK_FIRST_STK_SIZE];  /* Start task stack                        *//***********************************************************************************************************                                             PROTOTYPES**********************************************************************************************************/static  void     AppTaskFirst(void *p_arg);/***********************************************************************************************************                                              main()* * Description: This is the 'standard' C startup entry point.  main() does the following:*              *              1) Initialize uC/OS-II*              2) Create a single task*              3) Start uC/OS-II** Arguments  : None** Returns    : main() should NEVER return**********************************************************************************************************/int  main (void){    INT8U    err;    BSP_IntDisAll();                         /* Make sure interrupts are disabled on interrupt controller */    OSInit();                                /* Initialize uC/OS-II                                       */    OSTaskCreateExt(AppTaskFirst,                   (void *)0,                   &AppTaskFirstStk[APP_TASK_FIRST_STK_SIZE - 1],                   APP_TASK_FIRST_PRIO,                   APP_TASK_FIRST_ID,                   &AppTaskFirstStk[0],                   APP_TASK_FIRST_STK_SIZE,                   (void *)0,                   OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);    OSTaskNameSet(APP_TASK_FIRST_PRIO, "App Task First", &err);    OSStart();                               /* Start multitasking                                        */}/*$PAGE*//***********************************************************************************************************                                             AppTaskFirst()* * Description: This is the first task executed by uC/OS-II following OSStart()*              * Arguments  : p_arg        Argument passed to this task when task is created.  The argument is not used.** Returns    : None**********************************************************************************************************/static  void  AppTaskFirst (void *p_arg){    p_arg = p_arg;
	 
	 BSP_InitIO();
#if OS_TASK_STAT_EN > 0
    OSStatInit();
#endif

    while (1) {
	     LED_Toggle(1);
		  OSTimeDly(LED_INTERVAL);
    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?