📄 test.c
字号:
/*********************************************************************************************************** uC/OS-II* The Real-Time Kernel** EX1_OS*** Description: Shows an example of how to use uCOS-II with the MicroBlaze processor. **********************************************************************************************************/#include "includes.h"/*********************************************************************************************************** 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){ (void)p_arg; /* Prevent compiler warning by doing something with argument */ BSP_InitIO(); /* Initialize the I/Os */#if OS_TASK_STAT_EN > 0 OSStatInit(); /* Initialize uC/OS-II's statistics */#endif while (1) { LED_Toggle(1); OSTimeDlyHMSM(0,0,0,300); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -