本文整理汇总了C++中OSTaskCreateExt函数的典型用法代码示例。如果您正苦于以下问题:C++ OSTaskCreateExt函数的具体用法?C++ OSTaskCreateExt怎么用?C++ OSTaskCreateExt使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OSTaskCreateExt函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(void){
MainQueue = OSQCreate(&QueueBaseAddress[0], QUEUE_SIZE);
OSTaskCreateExt(Encoder_Task,
NULL,
(void *)&task1_stk[TASK_STACKSIZE-1],
TASK1_PRIORITY,
TASK1_PRIORITY,
task1_stk,
TASK_STACKSIZE,
NULL,
0);
OSTaskCreateExt(PWM_Task,
NULL,
(void *)&task2_stk[TASK_STACKSIZE-1],
TASK2_PRIORITY,
TASK2_PRIORITY,
task2_stk,
TASK_STACKSIZE,
NULL,
0);
OSTaskCreateExt(ADC_Task,
NULL,
(void *)&task3_stk[TASK_STACKSIZE-1],
TASK3_PRIORITY,
TASK3_PRIORITY,
task3_stk,
TASK_STACKSIZE,
NULL,
0);
OSTaskCreateExt(LSM303_Task,
NULL,
(void *)&task4_stk[TASK_STACKSIZE-1],
TASK4_PRIORITY,
TASK4_PRIORITY,
task4_stk,
TASK_STACKSIZE,
NULL,
0);
OSTaskCreateExt(Navigation_Task,
NULL,
(void *)&task5_stk[TASK_STACKSIZE-1],
TASK5_PRIORITY,
TASK5_PRIORITY,
task5_stk,
TASK_STACKSIZE,
NULL,
0);
//OS_Start();
return 0;
// LSM303_Init();
//enableDefault();
}
示例2: p2_init
/**
\brief This is the entry point in the application code.
*/
int p2_init(void) {
INT8U osErr;
//==== initialize local variables
memset(&uart_app_v,0x00,sizeof(uart_app_v));
uart_app_v.uartTxLen = DLFT_LEN;
uart_app_v.uartTxDelay = DLFT_DELAY;
//==== initialize helper tasks
cli_task_init(
"uart", // appName
cliCmdDefs // cliCmds
);
loc_task_init(
JOIN_NO, // fJoin
NETID_NONE, // netId
UDPPORT_NONE, // udpPort
NULL, // joinedSem
BANDWIDTH_NONE, // bandwidth
NULL // serviceSem
);
//===== create tasks
// uartTxTask task
osErr = OSTaskCreateExt(
uartTxTask,
(void *)0,
(OS_STK*)(&uart_app_v.uartTxTaskStack[TASK_APP_UART_TX_STK_SIZE-1]),
TASK_APP_UART_TX_PRIORITY,
TASK_APP_UART_TX_PRIORITY,
(OS_STK*)uart_app_v.uartTxTaskStack,
TASK_APP_UART_TX_STK_SIZE,
(void *)0,
OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR
);
ASSERT(osErr == OS_ERR_NONE);
OSTaskNameSet(TASK_APP_UART_TX_PRIORITY, (INT8U*)TASK_APP_UART_TX_NAME, &osErr);
ASSERT(osErr == OS_ERR_NONE);
// uartRxTask task
osErr = OSTaskCreateExt(
uartRxTask,
(void *)0,
(OS_STK*)(&uart_app_v.uartRxTaskStack[TASK_APP_UART_RX_STK_SIZE-1]),
TASK_APP_UART_RX_PRIORITY,
TASK_APP_UART_RX_PRIORITY,
(OS_STK*)uart_app_v.uartRxTaskStack,
TASK_APP_UART_RX_STK_SIZE,
(void *)0,
OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR
);
ASSERT(osErr == OS_ERR_NONE);
OSTaskNameSet(TASK_APP_UART_RX_PRIORITY, (INT8U*)TASK_APP_UART_RX_NAME, &osErr);
ASSERT(osErr == OS_ERR_NONE);
return 0;
}
示例3: ProbeRS232_OS_Init
void ProbeRS232_OS_Init (void)
{
#if (OS_TASK_NAME_SIZE > 13) || (OS_EVENT_NAME_SIZE > 13)
CPU_INT08U err;
#endif
#if (OS_SEM_EN > 0)
ProbeRS232_OS_Sem = OSSemCreate(0);
#if (OS_EVENT_NAME_SIZE > 16)
OSEventNameSet(ProbeRS232_OS_Sem, (CPU_INT08U *)"uC/Probe RS-232", &err);
#elif (OS_EVENT_NAME_SIZE > 13)
OSEventNameSet(ProbeRS232_OS_Sem, (CPU_INT08U *)"Probe RS-232", &err);
#endif
#endif
#if (OS_TASK_CREATE_EXT_EN > 0)
#if (OS_STK_GROWTH == 1)
err = OSTaskCreateExt( ProbeRS232_OS_Task,
(void *)0,
&ProbeRS232_OS_TaskStk[PROBE_RS232_TASK_STK_SIZE - 1],/* Set Top-Of-Stack. */
PROBE_RS232_TASK_PRIO,
PROBE_RS232_TASK_PRIO,
&ProbeRS232_OS_TaskStk[0], /* Set Bottom-Of-Stack. */
PROBE_RS232_TASK_STK_SIZE,
(void *)0, /* No TCB extension. */
OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR); /* Enable stack checking + clear stack. */
#else
err = OSTaskCreateExt( ProbeRS232_OS_Task,
p_arg,
&ProbeRS232_OS_TaskStk[0], /* Set Top-Of-Stack. */
PROBE_RS232_TASK_PRIO,
PROBE_RS232_TASK_PRIO,
&ProbeRS232_OS_TaskStk[PROBE_RS232_TASK_STK_SIZE - 1],/* Set Bottom-Of-Stack. */
PROBE_RS232_TASK_STK_SIZE,
(void *)0, /* No TCB extension. */
OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR); /* Enable stack checking + clear stack. */
#endif
#else
#if (OS_STK_GROWTH == 1)
err = OSTaskCreate( ProbeRS232_OS_Task,
p_arg,
&ProbeRS232_OS_TaskStk[PROBE_RS232_TASK_STK_SIZE - 1],
PROBE_RS232_TASK_PRIO);
#else
err = OSTaskCreate( ProbeRS232_OS_Task,
p_arg,
&ProbeRS232_OS_TaskStk[0],
PROBE_RS232_TASK_PRIO);
#endif
#endif
#if (OS_TASK_NAME_SIZE > 16)
OSTaskNameSet(PROBE_RS232_TASK_PRIO, (CPU_INT08U *)"uC/Probe RS-232", &err);
#elif (OS_TASK_NAME_SIZE > 13)
OSTaskNameSet(PROBE_RS232_TASK_PRIO, (CPU_INT08U *)"Probe RS-232", &err);
#endif
}
示例4: TaskStart
/********************************* uCOS�������� *************************************/
void TaskStart(void *pdata)
{
stm32_crc_init();
OSTaskCreateExt(Display_Task,
(void *)0,
&Task_Display_Stk[Task_Display_Stk_Size - 1],
Task_Display_Prio,
Task_Display_Prio,
&Task_Display_Stk[0],
Task_Display_Stk_Size,
(void *)0,
OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);
OSTaskCreateExt(TaskADC,
(void *)0,
&Task_ADC_Stk[Task_ADC_Stk_Size - 1],
Task_ADC_Prio,
Task_ADC_Prio,
Task_ADC_Stk,
Task_ADC_Stk_Size,
(void *)0,
OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);
OSTaskCreateExt(Keyboard_Task,
(void *)0,
&Task_Key_Stk[Task_Key_Stk_Size - 1],
Task_Key_Prio,
Task_Key_Prio,
&Task_Key_Stk[0],
Task_Key_Stk_Size,
(void *)0,
OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);
OSTaskCreateExt(RC_Bus_Task,
(void *)0,
&Task_RCBus_Stk[Task_RCBus_Stk_Size - 1],
Task_RCBus_Prio,
Task_RCBus_Prio,
&Task_RCBus_Stk[0],
Task_RCBus_Stk_Size,
(void *)0,
OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);
OSTaskCreateExt(TaskUSBHID,
(void *)0,
&Task_USBHID_Stk[Task_USBHID_Stk_Size - 1],
Task_USBHID_Prio,
Task_USBHID_Prio,
&Task_USBHID_Stk[0],
Task_USBHID_Stk_Size,
(void *)0,
OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);
OSTaskDel(OS_PRIO_SELF);
}
示例5: App_TaskCreate
/*
*********************************************************************************************************
* App_TaskCreate()
*
* Description : Create the application tasks.
*
* Argument(s) : none.
*
* Return(s) : none.
*
* Note(s) : none.
*********************************************************************************************************
*/
static void App_TaskCreate (void)
{
#if (OS_TASK_NAME_EN > 0)
CPU_INT08U err;
#endif
/* Create the One task */
OSTaskCreateExt((void (*)(void *)) APP_TaskOne,
(void *) 0,
(OS_STK *)&App_TaskOneStk[APP_CFG_TASK_ONE_STK_SIZE - 1],
(INT8U ) APP_CFG_TASK_ONE_PRIO,
(INT16U ) APP_CFG_TASK_ONE_PRIO,
(OS_STK *)&App_TaskOneStk[0],
(INT32U ) APP_CFG_TASK_ONE_STK_SIZE,
(void *) 0,
#ifdef __ICCARM__ /* IAR port */
(INT16U )(OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR | OS_TASK_OPT_SAVE_FP));
#else
(INT16U )(OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR));
#endif
/* Create the Two task */
OSTaskCreateExt((void (*)(void *)) APP_TaskTwo,
(void *) 0,
(OS_STK *)&App_TaskTwoStk[APP_CFG_TASK_TWO_STK_SIZE - 1],
(INT8U ) APP_CFG_TASK_TWO_PRIO,
(INT16U ) APP_CFG_TASK_TWO_PRIO,
(OS_STK *)&App_TaskTwoStk[0],
(INT32U ) APP_CFG_TASK_TWO_STK_SIZE,
(void *) 0,
#ifdef __ICCARM__ /* IAR port */
(INT16U )(OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR | OS_TASK_OPT_SAVE_FP));
#else
(INT16U )(OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR));
#endif
/* Create the Three task */
OSTaskCreateExt((void (*)(void *)) APP_TaskThree,
(void *) 0,
(OS_STK *)&App_TaskThreeStk[APP_CFG_TASK_TWO_STK_SIZE - 1],
(INT8U ) APP_CFG_TASK_THREE_PRIO,
(INT16U ) APP_CFG_TASK_THREE_PRIO,
(OS_STK *)&App_TaskThreeStk[0],
(INT32U ) APP_CFG_TASK_THREE_STK_SIZE,
(void *) 0,
#ifdef __ICCARM__ /* IAR port */
(INT16U )(OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR | OS_TASK_OPT_SAVE_FP));
#else
(INT16U )(OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR));
#endif
#if (OS_TASK_NAME_EN > 0)
OSTaskNameSet(APP_CFG_TASK_ONE_PRIO, "One", &err);
OSTaskNameSet(APP_CFG_TASK_TWO_PRIO, "Two", &err);
OSTaskNameSet(APP_CFG_TASK_TWO_PRIO, "Three", &err);
#endif
}
示例6: main
/* The main function creates the LCD task, registers the edge counter polling interrupt,
* and starts the OS. */
int main(void)
{
int status;
// Initialize components.
queue_init();
// Create the IR task.
OSTaskCreateExt(ir_task,
NULL,
&ir_task_stk[TASK_STACKSIZE - 1],
IR_TASK_PRIORITY,
IR_TASK_PRIORITY,
ir_task_stk,
TASK_STACKSIZE,
NULL,
0);
// Create the Wifi task.
OSTaskCreateExt(wifi_task,
NULL,
&wifi_task_stk[TASK_STACKSIZE - 1],
WIFI_TASK_PRIORITY,
WIFI_TASK_PRIORITY,
wifi_task_stk,
TASK_STACKSIZE,
NULL,
0);
// Create the MC task.
OSTaskCreateExt(mc_task,
NULL,
&mc_task_stk[TASK_STACKSIZE - 1],
MC_TASK_PRIORITY,
MC_TASK_PRIORITY,
mc_task_stk,
TASK_STACKSIZE,
NULL,
0);
// Register the IR pushbutton interrupt.
status = alt_ic_isr_register(PIO_KEY_LEFT_IRQ_INTERRUPT_CONTROLLER_ID,
PIO_KEY_LEFT_IRQ,
isr_on_ir_pushbutton,
NULL,
NULL);
// Enable key interrupts.
IOWR_ALTERA_AVALON_PIO_IRQ_MASK(PIO_KEY_LEFT_BASE, PIO_KEY_LEFT_CAPTURE);
// Start.
if (status == OK) {
OSStart();
}
return 0;
}
示例7: main
int main(void)
{
OSInit();
volatile short * pixel_ctrl_ptr = pixel_buffer_start;
volatile char * char_ctrl_ptr = character_buffer;
int err = ALT_SEM_CREATE(&display,1);
if(err != 0)
printf("Semaphore not created\n");
err = ALT_SEM_CREATE(&audio,1);
if(err != 0)
printf("Semaphore not created\n");
*(dma_control) &= (1<<2); //Enable DMA controller
clearscreen(pixel_ctrl_ptr);
drawbox(pixel_ctrl_ptr, 34*4, 9*4, 48, 10,0xFA01);
wait_for_vsync(buffer_register,dma_control);
OSTaskCreateExt(task1,
pixel_ctrl_ptr,
(void *)&task1_stk[TASK_STACKSIZE-1],
TASK1_PRIORITY,
TASK1_PRIORITY,
task1_stk,
TASK_STACKSIZE,
NULL,
0);
OSTaskCreateExt(task2,
char_ctrl_ptr,
(void *)&task2_stk[TASK_STACKSIZE-1],
TASK2_PRIORITY,
TASK2_PRIORITY,
task2_stk,
TASK_STACKSIZE,
NULL,
0);
OSTaskCreateExt(getcontrols,
char_ctrl_ptr,
(void *)&getcontrols_stk[TASK_STACKSIZE-1],
GETCONTROLS_PRIORITY,
GETCONTROLS_PRIORITY,
getcontrols_stk,
TASK_STACKSIZE,
NULL,
0);
OSStart();
return 0;
}
示例8: main
int main(void)
{
#if (OS_TASK_NAME_EN > 0)
CPU_INT08U err;
#endif
SYS_UnlockReg();
BSP_Init(); /* Initialize BSP functions */
BSP_Set_PLL_Freq(CLK_XTL_12M, PLL_DEFAULT_HZ); /* Configure PLL */
BSP_Set_System_Clock(CLK_PLL, 0); /* Select HCLK source clock as PLL */
SYS_LockReg();
OSInit(); /* Initialize "uC/OS-II, The Real-Time Kernel" */
CPU_Init(); /* Initialize the uC/CPU services */
Mem_Init(); /* Initialize memory managment module */
Math_Init(); /* Initialize mathematical module */
#if (OS_TASK_STAT_EN > 0)
OSStatInit(); /* Determine CPU capacity */
#endif
OSTaskCreateExt((void (*)(void *)) AppTask_1, /* Create the test task */
(void *) 0,
(OS_STK *)&StackOfTask_1[TASK_STACK_SIZE - 1],
(INT8U ) TASK_1_PRIO,
(INT16U ) TASK_1_PRIO,
(OS_STK *)&StackOfTask_1[0],
(INT32U ) TASK_STACK_SIZE,
(void *) 0,
(INT16U )(OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR));
OSTaskCreateExt((void (*)(void *)) AppTask_2, /* Create the start task */
(void *) 0,
(OS_STK *)&StackOfTask_2[TASK_STACK_SIZE - 1],
(INT8U ) TASK_2_PRIO,
(INT16U ) TASK_2_PRIO,
(OS_STK *)&StackOfTask_2[0],
(INT32U ) TASK_STACK_SIZE,
(void *) 0,
(INT16U )(OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR));
#if (OS_TASK_NAME_EN > 0)
OSTaskNameSet(TASK_1_PRIO, "Task 1", &err);
OSTaskNameSet(TASK_2_PRIO, "Task 2", &err);
#endif
OSStart(); /* Start multitasking (i.e. give control to uC/OS-II) */
return (1);
}
示例9: main
/* The main function creates two task and starts multi-tasking */
int main(void)
{
task t1 = {4,60}; // CPU exec, Period
task t2 = {1,70};
task t3 = {2,80};
INT8U err;
OSInit();
OSTaskCreateExt(task1,
&t1,
(void *)&task1_stk[TASK_STACKSIZE-1],
TASK1_PRIORITY,
TASK1_PRIORITY,
task1_stk,
TASK_STACKSIZE,
NULL,
0,
t1.period);
OSTaskCreateExt(task2,
&t2,
(void *)&task2_stk[TASK_STACKSIZE-1],
TASK2_PRIORITY,
TASK2_PRIORITY,
task2_stk,
TASK_STACKSIZE,
NULL,
0,
t2.period);
OSTaskCreateExt(task3,
&t3,
(void *)&task3_stk[TASK_STACKSIZE-1],
TASK3_PRIORITY,
TASK3_PRIORITY,
task3_stk,
TASK_STACKSIZE,
NULL,
0,
t3.period);
R1 = OSMutexCreate(R1_PRIO, &err);
R2 = OSMutexCreate(R2_PRIO, &err);
printf("====== SRP Task Set 2 { t1(9,60), t2(3,70), t3(0,80) } (Arrival,Period) ======\n");
printf("------------------------------------------------------------------------------\n");
printf("Current Time Event System Ceiling \n");
printf("------------------------------------------------------------------------------\n");
OSTimeSet(0);
OSStart();
return 0;
}
示例10: OSView_InitOS
static void OSView_InitOS (void)
{
#if OS_TASK_NAME_EN > 0 || OS_EVENT_NAME_SIZE > 7
INT8U err;
#endif
#if OS_SEM_EN > 0
OSView_Sem = OSSemCreate(0);
#if OS_EVENT_NAME_EN > 0
OSEventNameSet(OSView_Sem, (INT8U *)"uC/OS-View Signal", &err);
#endif
#endif
#if OS_TASK_CREATE_EXT_EN > 0
#if OS_STK_GROWTH == 1
(void)OSTaskCreateExt(OSView_Task,
(void *)0, /* No arguments passed to OSView_Task() */
&OSView_TaskStk[OS_VIEW_TASK_STK_SIZE - 1], /* Set Top-Of-Stack */
OS_VIEW_TASK_PRIO, /* Lowest priority level */
OS_VIEW_TASK_ID,
&OSView_TaskStk[0], /* Set Bottom-Of-Stack */
OS_VIEW_TASK_STK_SIZE,
(void *)0, /* No TCB extension */
OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR); /* Enable stack checking + clear stack */
#else
(void)OSTaskCreateExt(OSView_Task,
(void *)0, /* No arguments passed to OSView_Task() */
&OSView_TaskStk[0], /* Set Top-Of-Stack */
OS_VIEW_TASK_PRIO, /* Lowest priority level */
OS_VIEW_TASK_ID,
&OSView_TaskStk[OS_VIEW_TASK_STK_SIZE - 1], /* Set Bottom-Of-Stack */
OS_VIEW_TASK_STK_SIZE,
(void *)0, /* No TCB extension */
OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR); /* Enable stack checking + clear stack */
#endif
#else
#if OS_STK_GROWTH == 1
(void)OSTaskCreate(OSView_Task,
(void *)0,
&OSView_TaskStk[OS_VIEW_TASK_STK_SIZE - 1],
OS_VIEW_TASK_PRIO);
#else
(void)OSTaskCreate(OSView_Task,
(void *)0,
&OSView_TaskStk[0],
OS_VIEW_TASK_PRIO);
#endif
#endif
#if OS_TASK_NAME_EN > 0
OSTaskNameSet(OS_VIEW_TASK_PRIO, (INT8U *)"uC/OS-View", &err);
#endif
}
示例11: OSProbe_InitOS
static void OSProbe_InitOS (void)
{
INT8U err;
#if (OS_TASK_CREATE_EXT_EN > 0)
#if (OS_STK_GROWTH == 1)
err = OSTaskCreateExt((void (*)(void *)) OSProbe_Task,
(void * ) 0,
(OS_STK * )&OSProbe_TaskStk[OS_PROBE_TASK_STK_SIZE - 1],
(INT8U ) OS_PROBE_TASK_PRIO,
(INT16U ) OS_PROBE_TASK_PRIO,
(OS_STK * )&OSProbe_TaskStk[0],
(INT32U ) OS_PROBE_TASK_STK_SIZE,
(void * ) 0,
(INT16U )(OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR));
#else
err = OSTaskCreateExt((void (*)(void *)) OSProbe_Task,
(void * ) 0,
(OS_STK * )&OSProbe_TaskStk[0],
(INT8U ) OS_PROBE_TASK_PRIO,
(INT16U ) OS_PROBE_TASK_PRIO,
(OS_STK * )&OSProbe_TaskStk[OS_PROBE_TASK_STK_SIZE - 1],
(INT32U ) OS_PROBE_TASK_STK_SIZE,
(void * ) 0,
(INT16U )(OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR));
#endif
#else
#if (OS_STK_GROWTH == 1)
err = OSTaskCreate((void (*)(void *)) OSProbe_Task,
(void * ) 0,
(OS_STK * )&OSProbe_TaskStk[OS_PROBE_TASK_STK_SIZE - 1],
(INT8U ) OS_PROBE_TASK_PRIO);
#else
err = OSTaskCreate((void (*)(void *)) OSProbe_Task,
(void * ) 0,
(OS_STK * )&OSProbe_TaskStk[0],
(INT8U ) OS_PROBE_TASK_PRIO);
#endif
#endif
#if (OS_VERSION < 287)
#if (OS_TASK_NAME_SIZE > 1)
OSTaskNameSet(OS_PROBE_TASK_PRIO, (INT8U *)"Probe OS PlugIn", &err);
#endif
#else
#if (OS_TASK_NAME_EN > 0)
OSTaskNameSet(OS_PROBE_TASK_PRIO, (INT8U *)"Probe OS PlugIn", &err);
#endif
#endif
(void)&err;
}
示例12: WSCreateTasks
static void WSCreateTasks()
{
INT8U error_code = OS_NO_ERR;
/* Start LED Task. */
error_code = OSTaskCreateExt(LED_task,
NULL,
(void *)&LEDTaskStk[TASK_STACKSIZE-1],
LED_PRIO,
LED_PRIO,
LEDTaskStk,
TASK_STACKSIZE,
NULL,
0);
alt_uCOSIIErrorHandler(error_code, 0);
/* Start SSD Task. */
#ifdef SEG7_NAME
error_code = OSTaskCreateExt(SSD_task,
NULL,
(void *)&SSDTaskStk[TASK_STACKSIZE-1],
SSD_PRIO,
SSD_PRIO,
SSDTaskStk,
TASK_STACKSIZE,
NULL,
0);
alt_uCOSIIErrorHandler(error_code, 0);
#endif
/* Start Board Control Task. */
error_code = OSTaskCreateExt(board_control_task,
NULL,
(void *)&BCTaskStk[TASK_STACKSIZE-1],
BOARD_PRIO,
BOARD_PRIO,
BCTaskStk,
TASK_STACKSIZE,
NULL,
0);
alt_uCOSIIErrorHandler(error_code, 0);
/* Suspend both the LED and SSD tasks on start. */
OSTaskSuspend(LED_PRIO);
OSTaskSuspend(SSD_PRIO);
/* The web server task is started by the Interniche stack, as the "main" network servicing task. */
}
示例13: main
void main (void)
{
// VectorInit(1); // change pointer to int vectors for test
pll_init(120); // Set the 5509 to 120MHz
OSInit(); /* Initialize MicroC/OS-II */
// printf ("Alpha port test for MicroC/OS-II for 5509-DSP.\n");
// printf (" Port to TI TMS320VC5509 \n");
// printf ("\n");
MySem =OSSemCreate(1);
err = OSTaskCreateExt(TaskStart,
(void *)0,
(void *)&TaskStartStk[TASKSTART_STK_SIZE-1],
10,
10,
(void *)(&TaskStartStk[0]),
TASKSTART_STK_SIZE,
(void *)&TaskStart_SStk[TASKSTART_SSTK_SIZE-1],
OS_TASK_OPT_STK_CLR + OS_TASK_OPT_STK_CHK);
OSTaskNameSet(0, "TaskStart", &err);
err = OSTaskCreateExt(Tasksecond,
(void *)0,
(void *)&Task2Stk[TASK_STK_SIZE-1],
11,
11,
(void *)(&Task2Stk[0]),
TASK_STK_SIZE,
(void *)&Task2_SStk[TASK_SSTK_SIZE-1],
OS_TASK_OPT_STK_CLR + OS_TASK_OPT_STK_CHK);
OSTaskNameSet(1, "TaskSecond", &err);
err = OSTaskCreateExt(Taskthird,
(void *)0,
(void *)&Task3Stk[TASK_STK_SIZE-1],
12,
12,
(void *)(&Task3Stk[0]),
TASK_STK_SIZE,
(void *)&Task3_SStk[TASK_SSTK_SIZE-1],
OS_TASK_OPT_STK_CLR + OS_TASK_OPT_STK_CHK);
OSTaskNameSet(2, "TaskThird", &err);
OSStart(); /* Start multitasking */
}
示例14: OSTmr_InitTask
static void OSTmr_InitTask (void)
{
#if OS_TASK_NAME_SIZE > 6
INT8U err;
#endif
#if OS_TASK_CREATE_EXT_EN > 0
#if OS_STK_GROWTH == 1
(void)OSTaskCreateExt(OSTmr_Task,
(void *)0, /* No arguments passed to OSTmrTask() */
&OSTmrTaskStk[OS_TASK_TMR_STK_SIZE - 1], /* Set Top-Of-Stack */
OS_TASK_TMR_PRIO,
OS_TASK_TMR_ID,
&OSTmrTaskStk[0], /* Set Bottom-Of-Stack */
OS_TASK_TMR_STK_SIZE,
(void *)0, /* No TCB extension */
OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR); /* Enable stack checking + clear stack */
#else
(void)OSTaskCreateExt(OSTmr_Task,
(void *)0, /* No arguments passed to OSTmrTask() */
&OSTmrTaskStk[0], /* Set Top-Of-Stack */
OS_TASK_TMR_PRIO,
OS_TASK_TMR_ID,
&OSTmrTaskStk[OS_TASK_TMR_STK_SIZE - 1], /* Set Bottom-Of-Stack */
OS_TASK_TMR_STK_SIZE,
(void *)0, /* No TCB extension */
OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR); /* Enable stack checking + clear stack */
#endif
#else
#if OS_STK_GROWTH == 1
(void)OSTaskCreate(OSTmr_Task,
(void *)0,
&OSTmrTaskStk[OS_TASK_TMR_STK_SIZE - 1],
OS_TASK_TMR_PRIO);
#else
(void)OSTaskCreate(OSTmr_Task,
(void *)0,
&OSTmrTaskStk[0],
OS_TASK_TMR_PRIO);
#endif
#endif
#if OS_TASK_NAME_SIZE > 12
OSTaskNameSet(OS_TASK_TMR_PRIO, (INT8U *)"uC/OS-II Tmr", &err);
#else
#if OS_TASK_NAME_SIZE > 6
OSTaskNameSet(OS_TASK_TMR_PRIO, (INT8U *)"OS-Tmr", &err);
#endif
#endif
}
示例15: main
/* The main function creates two task and starts multi-tasking */
int main(void)
{
alt_printf("*********************************************\n");
alt_printf("* Running MicroC OS on the DE0-nano Board *\n");
alt_printf("*********************************************\n");
OSTaskCreateExt(task1, NULL, (void *)&task1_stk[TASK_STACKSIZE-1], TASK1_PRIORITY, TASK1_PRIORITY, task1_stk, TASK_STACKSIZE, NULL, 0);
OSTaskCreateExt(task2, NULL, (void *)&task2_stk[TASK_STACKSIZE-1], TASK2_PRIORITY, TASK2_PRIORITY, task2_stk, TASK_STACKSIZE, NULL, 0);
OSStart();
return 0;
}