📄 app.c
字号:
/*********************************************************************************************************** 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -