static void AppTaskFirst (void *p_arg) { if (DEBUG) xil_printf("DEBUG: INSIDE AppTaskFirst\n\r"); p_arg = 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 AppTaskCreate(); /* La resta de tasques de l'aplicació es crean normalment */ /* dins d'una altra funció per tal de mantenir neta la secció */ /* de codi corresponent a la funció m */ int led = 0; // S3A400 - initialize LED selector while (1) { if (DEBUG) xil_printf("DEBUG: INSIDE AppTaskFirst while\n\r"); //BSP_LEDToggle(led + 1); // S3A400 - Light selected LED, all others off OSTimeDlyHMSM(0,0,5,0); // Release the CPU (every 5 second) //led = (led + 1) % LEDS; // S3A400 - Select next LED } }
static void AppTaskStart (void *p_arg) { (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 managment module */ Math_Init(); /* Initialize mathematical module */ #if (OS_TASK_STAT_EN > 0) OSStatInit(); /* Determine CPU capacity */ #endif BSP_LED_Off(0); #if (APP_CFG_SERIAL_EN == DEF_ENABLED) App_SerialInit(); /* Initialize Serial communication for application ... */ #endif APP_TRACE_INFO(("Creating Application Events...\n\r")); AppEventCreate(); /* Create Application Events */ APP_TRACE_INFO(("Creating Application Tasks...\n\r")); AppTaskCreate(); /* Create application tasks */ while (DEF_TRUE) { /* Task body, always written as an infinite loop. */ BSP_LED_Toggle(0); OSTimeDlyHMSM(0, 0, 0, 100); } }
static void AppTaskStart (void *p_arg) { #if CPU_CFG_CRITICAL_METHOD == CPU_CRITICAL_METHOD_STATUS_LOCAL CPU_SR cpu_sr; #endif CPU_INT08U i; CPU_INT08U j; (void)p_arg; BSP_InitIO(); /* Initialize BSP functions */ #if PROBE_COM_METHOD_RS232 == DEF_FALSE UART_Init(); /* Initialize serial port */ #endif #if (OS_TASK_STAT_EN > 0) OSStatInit(); /* Determine CPU capacity */ #endif #if (uC_PROBE_OS_PLUGIN > 0) || (uC_PROBE_COM_MODULE > 0) AppProbeInit(); /* Initialize uC/Probe modules */ #endif AppTaskCreate(); /* Create application tasks */ while (OS_TRUE) { /* Task body, always written as an infinite loop. */ for (j = 0; j < 2; j++) { for (i = 1; i < 9; i++) { LED_Toggle(i); OSTimeDlyHMSM(0, 0, 0, ADC_GetVal() + 10); } for (i = 0; i < 8; i++) { LED_Toggle(0); OSTimeDlyHMSM(0, 0, 0, ADC_GetVal() + 10); } } for ( ; j > 0; j--) { for (i = 9; i > 0; --i) { LED_Toggle(i); OSTimeDlyHMSM(0, 0, 0, ADC_GetVal() + 10); } for (i = 0; i < 8; i++) { LED_Toggle(0); OSTimeDlyHMSM(0, 0, 0, ADC_GetVal() + 10); } } } }
void Launcher_Exec(void) { AppMemCreate(); // ║зк┌╠ь╝М // AppFlagCreate(); // AppQCreate(); // AppMutexCreate(); AppSemCreate(); AppTaskCreate(); }
static void AppTaskStart (void *p_arg) { (void)p_arg; BSP_Init(); /* Initialize BSP functions */ #if (OS_TASK_STAT_EN > 0) OSStatInit(); /* Determine CPU capacity */ #endif AppDispInit(); /* Initialize the Display layout */ AppTaskCreate(); /* Create application tasks */ while (1) { /* Task body, always written as an infinite loop. */ AppDispUpdate(); OSTimeDlyHMSM(0, 0, 0, 100); } }
static void AppTaskStart (void *p_arg) { (void)p_arg; /* Init BSP */ BSP_Init(); /* Init lwip stack ¡¢add network interface */ lwIP_Init(); /* Init Tcp server */ Telnet_init(); /* Create application task */ AppTaskCreate(); while(DEF_TRUE) { OSTimeDlyHMSM(0, 0, 1, 0); } }
static void FirstTask (void *p_arg) { p_arg = p_arg; BSP_InitIO(); #if OS_TASK_STAT_EN > 0 OSStatInit(); #endif AppTaskCreate(); /* The other tasks in the application are generally */ /* created in a separate function to reduce clutter */ /* in main */ while (1) { xil_printf("First task says Hello World\n"); //printf("First task says Hello World\n"); OSTimeDlyHMSM(0,0,3,0); } }
static void AppTaskStart (void *p_arg) { CPU_INT32U freq; CPU_INT32U cnts; OS_ERR err; (void)p_arg; BSP_Init(); /* Initialize BSP functions */ CPU_Init(); /* Initialize the uC/CPU services */ freq = BSP_CPU_ClkFreq(); /* Determine SysTick reference freq. */ cnts = freq / (CPU_INT32U)OSCfg_TickRate_Hz; /* Determine nbr SysTick increments */ OS_CPU_SysTickInit(cnts); /* Init uC/OS periodic time src (SysTick). */ #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 AppEventCreate(); /* Create Application Kernel objects */ AppTaskCreate(); /* Create application tasks */ while (DEF_TRUE) { /* Task body, always written as an infinite loop. */ OSTimeDlyHMSM(0, 0, 0, 200, /* Delay task for 200 ms */ OS_OPT_TIME_HMSM_STRICT, &err); } }
static void AppTaskStart (void *p_arg) { OS_ERR err; (void)p_arg; BSP_Tick_Init(); bsp_Init(); CPU_Init(); //Mem_Init(); //内存管理模块 // Math_Init(); #if OS_CFG_STAT_TASK_EN > 0u OSStatTaskCPUUsageInit(&err); #endif #ifdef CPU_CFG_INT_DIS_MEAS_EN CPU_IntDisMeasMaxCurReset(); #endif AppTimerCreate(); AppObjCreate(); AppTaskCreate(); while (1) { //GPIOG->ODR ^= GPIO_Pin_10; //添加LED指示灯,指示星务计算机工作状态 2014/10/18 BSP_OS_TimeDlyMs(2000); //printf("living!\r\n"); //bsp_LedToggle(1); //bsp_LedToggle(2); //bsp_LedToggle(3); } }
static void AppTaskStart (void *p_arg) { OS_ERR err; CPU_INT32U r0; CPU_INT32U r1; CPU_INT32U r2; CPU_INT32U r3; CPU_INT32U r4; CPU_INT32U r5; CPU_INT32U r6; CPU_INT32U r7; CPU_INT32U r8; CPU_INT32U r9; CPU_INT32U r10; CPU_INT32U r11; CPU_INT32U r12; (void)p_arg; r0 = 0u; /* Initialize local variables. */ r1 = 1u; r2 = 2u; r3 = 3u; r4 = 4u; r5 = 5u; r6 = 6u; r7 = 7u; r8 = 8u; r9 = 9u; r10 = 10u; r11 = 11u; r12 = 12u; BSP_Init(); /* Initialize BSP functions */ CPU_Init(); /* Initialize the uC/CPU services */ #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 #if (APP_CFG_SERIAL_EN == DEF_ENABLED) App_SerialInit(); /* Initialize Serial Communication for Application ... */ #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 */ BSP_LED_Off(0u); while (DEF_TRUE) { /* Task body, always written as an infinite loop. */ BSP_LED_Toggle(0u); OSTimeDlyHMSM(0u, 0u, 0u, 100u, OS_OPT_TIME_HMSM_STRICT, &err); if ((r0 != 0u) || /* Check task context. */ (r1 != 1u) || (r2 != 2u) || (r3 != 3u) || (r4 != 4u) || (r5 != 5u) || (r6 != 6u) || (r7 != 7u) || (r8 != 8u) || (r9 != 9u) || (r10 != 10u) || (r11 != 11u) || (r12 != 12u)) { APP_TRACE_INFO(("Context Error\n")); } } }