本文整理汇总了C++中OSStart函数的典型用法代码示例。如果您正苦于以下问题:C++ OSStart函数的具体用法?C++ OSStart怎么用?C++ OSStart使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OSStart函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main (void)
{
OS_ERR err;
CPU_IntDis(); /* Disable all interrupts. */
OSInit(&err); /* Init uC/OS-III. */
OSTaskCreate((OS_TCB *)&StartUp_TCB, /* Create the start task */
(CPU_CHAR *)"StartUp",
(OS_TASK_PTR ) Task_Start,
(void *) 0,
(OS_PRIO ) STARTUP_TASK_PRIO,
(CPU_STK *)&StartUp_Stk[0],
(CPU_STK_SIZE) STARTUP_TASK_STK_SIZE / 10u,
(CPU_STK_SIZE) STARTUP_TASK_STK_SIZE,
(OS_MSG_QTY ) 0u,
(OS_TICK ) 0u,
(void *) 0,
(OS_OPT )(OS_OPT_TASK_STK_CHK | OS_OPT_TASK_STK_CLR),
(OS_ERR *)&err);
OSStart(&err); /* Start multitasking (i.e. give control to uC/OS-III). */
while (1) {
;
}
}
示例2: osStartKernel
void osStartKernel(void)
{
OS_ERR err;
//Start the scheduler
OSStart(&err);
}
示例3: main
int main() {
/* Initialise the GPIO pins */
gpioPinInit(&pin[LED1], 1, 18, OUTPUT_PIN);
gpioPinInit(&pin[LED2], 0, 13, OUTPUT_PIN);
/* Initialise the OS */
OSInit();
/* Create the tasks */
OSTaskCreate(appTaskLED1,
(void *)0,
(OS_STK *)&appTaskLED1Stk[APP_TASK_LED1_STK_SIZE - 1],
APP_TASK_LED1_PRIO);
OSTaskCreate(appTaskLED2,
(void *)0,
(OS_STK *)&appTaskLED2Stk[APP_TASK_LED2_STK_SIZE - 1],
APP_TASK_LED2_PRIO);
/* Start the OS */
OSStart();
/* Should never arrive here */
return 0;
}
示例4: main
int main (int argc, char* argv[], char* envp[])
{
printf("We just started up!\n");
/*while(1){
if ( ( ~(*pushbutton_ptr) & BTNh_PEDESTRIAN) == BTN_PEDESTRIAN) {
printf("PED\n");
} else {
printf("PED is jumping\n");
}
*(green_LED_ptr) = *pushbutton_ptr;
}*/
//while (1)
// poller();
printf("Starting...\n");
*(red_LED_ptr) = 0;
*(green_LED_ptr) = 0;
INT8U return_code;
return_code = OSTaskCreate(monitorThread, NULL, (void*)&stack2[TASK_STACKSIZE-1], 0);
alt_ucosii_check_return_code(return_code);
return_code = OSTaskCreate(poller, NULL, (void*)&stack3[TASK_STACKSIZE-1], 1);
alt_ucosii_check_return_code(return_code);
OSStart();
return 0;
}
示例5: main
int main(void)
{
DelayInit();
SYSTICK_Init((1000*1000)/OS_TICKS_PER_SEC);
SYSTICK_ITConfig(true);
UART_QuickInit(UART0_RX_PD06_TX_PD07, 115200);
printf("uCOSII test\r\n");
OSInit(); //OS初始化
OSTaskCreate(AppLED1Task,(void *)0,
&APP_LED1_STK[TASK_STK_SIZE-1],
APP_LED1_TASK_PRIO); //建立LED1 任务
OSTaskCreate(AppLED0Task,(void *)0,
&APP_LED0_STK[TASK_STK_SIZE-1],
APP_LED0_TASK_PRIO); //建立LED0 任务
SYSTICK_Cmd(true);
/* 控制权交给操作系统 */
OSStart();
/* 程序永远不会运行到这 */
while(1);
}
示例6: main
int main(void)
{
CPU_INT08U os_err;
//禁止CPU中断
CPU_IntDis();
//UCOS 初始化
OSInit(); /* Initialize "uC/OS-II, The Real-Time Kernel". */
//硬件平台初始化
BSP_Init(); /* Initialize BSP functions. */
/* Configure FSMC Bank1 NOR/PSRAM */
I2C_Ini();
HMC5883L_Init();
HMC5883L_Start();
MPU6050_Init();
//建立主任务, 优先级最高 建立这个任务另外一个用途是为了以后使用统计任务
os_err = OSTaskCreate((void (*) (void *)) App_TaskStart, //指向任务代码的指针
(void *) 0, //任务开始执行时,传递给任务的参数的指针
(OS_STK *) &App_TaskStartStk[APP_TASK_START_STK_SIZE - 1], //分配给任务的堆栈的栈顶指针 从顶向下递减
(INT8U) APP_TASK_START_PRIO); //分配给任务的优先级
os_err =os_err;
//ucos的节拍计数器清0 节拍计数器是0-4294967295 对于节拍频率100hz时, 每隔497天就重新计数
OSTimeSet(0);
OSStart(); /* Start multitasking (i.e. give control to uC/OS-II). */
/* Start multitasking (i.e. give control to uC/OS-II). */
return (0);
}
示例7: main
int main(void)
{
OS_ERR err;
BSP_IntDisAll(); /* Disable all interrupts. */
CPU_Init(); /* Initialize the uC/CPU Services */
Mem_Init(); /* Initialize Memory Management Module */
Math_Init(); /* Initialize Mathematical Module */
OSInit(&err); /* Init uC/OS-III. */
OSTaskCreate((OS_TCB *)&AppTaskStartTCB, /* Create the start task */
(CPU_CHAR *)"App Task Start",
(OS_TASK_PTR )AppTaskStart,
(void *)0u,
(OS_PRIO )APP_CFG_TASK_START_PRIO,
(CPU_STK *)&AppTaskStartStk[0u],
(CPU_STK_SIZE )AppTaskStartStk[APP_CFG_TASK_START_STK_SIZE / 10u],
(CPU_STK_SIZE )APP_CFG_TASK_START_STK_SIZE,
(OS_MSG_QTY )0u,
(OS_TICK )0u,
(void *)0u,
(OS_OPT )(OS_OPT_TASK_STK_CHK | OS_OPT_TASK_STK_CLR),
(OS_ERR *)&err);
OSStart(&err); /* Start multitasking (i.e. give control to uC/OS-III). */
(void)&err;
return (0u);
}
示例8: main
void main(void)
{
//UBYTE err;
OSInit();
if (OSTaskCreate(Task1, NULL, &Task1Stk[TASK_STK_SIZE-1], TASK1_PRIO) != OS_ERR_NONE)
{
printf("erreur");
}
if (OSTaskCreate(Task2, NULL, &Task2Stk[TASK_STK_SIZE - 1], TASK2_PRIO) != OS_ERR_NONE)
{
printf("erreur");
}
if (OSTaskCreate(Task3, NULL, &Task3Stk[TASK_STK_SIZE - 1], TASK3_PRIO) != OS_ERR_NONE)
{
printf("erreur");
}
if (OSTaskCreate(Task4, NULL, &Task4Stk[TASK_STK_SIZE - 1], TASK4_PRIO) != OS_ERR_NONE)
{
printf("erreur");
}
if (OSTaskCreate(Task5, NULL, &Task5Stk[TASK_STK_SIZE - 1], TASK5_PRIO) != OS_ERR_NONE)
{
printf("erreur");
}
printf("End of Task creation\n");
OSStart();
// à compléter
return;
}
示例9: main
int main (void)
{
CPU_INT08U err;
//printf("Stack addr is 0x%x - 0x%x", &FirstTaskStk[0], &FirstTaskStk[TASK_STK_SIZE - 1] );
BSP_IntDisAll();
OSInit(); /* Initialize uC/OS-II */
/* Initialize RS232_Uart_1 - Set baudrate and number of stop bits */
XUartNs550_SetBaud(XPAR_RS232_UART_1_BASEADDR, XPAR_XUARTNS550_CLOCK_HZ, 9600);
XUartNs550_SetLineControlReg(XPAR_RS232_UART_1_BASEADDR, XUN_LCR_8_DATA_BITS);
//err = printf("Hello World\n");
OSTaskCreateExt(FirstTask,
(void *)0,
&FirstTaskStk[TASK_STK_SIZE - 1],
TASK1_ID,
TASK1_PRIO,
&FirstTaskStk[0],
TASK_STK_SIZE,
(void *)0,
OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);
OSTaskNameSet(TASK1_PRIO, (CPU_INT08U *)"FirstTask", &err);
OSStart(); /* Start Multitasking */
return 0; /* Process should never reach this point */
}
示例10: ucos_test
void ucos_test(void)
{
char *str1 = "!";
char *str2 = "?";
OSInit();
//mbox = OSQCreate (queue, sizeof(queue)/sizeof(queue[0]));
//dprintf("OSQCreate return:0x%8x\r\n",mbox);
/*install os timer*/
//sys_timer_start();
//OSTaskCreate(task1,(void *)str1,&task1_stk[1024],11);
//OSTaskCreate(task2,(void *)str2,&task2_stk[1024],10);
//OSTaskCreate(task3,(void *)"*",&task3_stk[1024],11);
//debug_enable = 1;
sys_thread_new("thread1", task1, str1, 1024, 8);
sys_thread_new("thread2", task2, str2, 1024, 9);
sys_thread_new("thread3", task3, str2, 1024, 10);
sys_mbox_new(&sys_mbox, 30);
//sys_sem_new(&sys_sem, 0);
sys_mutex_new(&sys_mutex);
OSStart();
while(1)
{
dprintf("os runtime error");
}
}
示例11: main
int main() {
/* Initialise the board support package */
bspInit();
/* Initialise the OS */
OSInit();
/* Create the tasks */
OSTaskCreate(appTaskLink,
(void *)0,
(OS_STK *)&appTaskLinkStk[APP_TASK_LINK_STK_SIZE - 1],
APP_TASK_LINK_PRIO);
OSTaskCreate(appTaskConnect,
(void *)0,
(OS_STK *)&appTaskConnectStk[APP_TASK_CONNECT_STK_SIZE - 1],
APP_TASK_CONNECT_PRIO);
OSTaskCreate(appTaskCANWrite,
(void *)0,
(OS_STK *)&appTaskCANWriteStk[APP_TASK_CAN_WRITE_STK_SIZE - 1],
APP_TASK_CAN_WRITE_PRIO);
OSTaskCreate(appTaskCANRead,
(void *)0,
(OS_STK *)&appTaskCANReadStk[APP_TASK_CAN_READ_STK_SIZE - 1],
APP_TASK_CAN_READ_PRIO);
/* Start the OS */
OSStart();
/* Should never arrive here */
return 0;
}
示例12: main
void main (void)
{
OSInit();
InitTimer2();
OSTaskCreate(sys_init, (void *)0, &sys_init_Stk[0],1);
OSStart();
}
示例13: main
int main (void)
{
#if (OS_TASK_NAME_SIZE > 7) && (OS_TASK_STAT_EN > 0)
CPU_INT08U err;
#endif
CPU_IntDis(); /* Disable all interrupts until we are ready to accept them */
OSInit();
BSP_Init();
init_err_printf();
OSTaskCreateExt(AppTaskStart,
(void *)0,
(OS_STK *)&AppTaskStartStk[APP_TASK_START_STK_SIZE - 1],
APP_TASK_START_PRIO,
APP_TASK_START_PRIO,
(OS_STK *)&AppTaskStartStk[0],
APP_TASK_START_STK_SIZE,
(void *)0,
OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);
#if (OS_TASK_NAME_SIZE > 7) && (OS_TASK_STAT_EN > 0)
OSTaskNameSet(APP_TASK_START_PRIO, (CPU_CHAR *)"Startup", &err);
#endif
OSStart();
info_printf("EVK1100_Interface to cyclone-III rustlight fpga starting\n");
return (0);
}
示例14: main
int main() {
/* Initialise the hardware */
bspInit();
conveyorInit();
/* Initialise the OS */
OSInit();
/* Create Tasks */
OSTaskCreate(appTaskEmergencyStop,
(void *)0,
(OS_STK *)&appTaskEmergencyStopStk[APP_TASK_EMERGENCY_STOP_STK_SIZE - 1],
APP_TASK_EMERGENCY_STOP_PRIO);
OSTaskCreate(appTaskMonitorSens1,
(void *)0,
(OS_STK *)&appTaskMonitorSens1Stk[APP_TASK_MONITOR_SENS1_STK_SIZE - 1],
APP_TASK_MONITOR_SENS1_PRIO);
OSTaskCreate(appTaskMonitorSens2,
(void *)0,
(OS_STK *)&appTaskMonitorSens2Stk[APP_TASK_MONITOR_SENS2_STK_SIZE - 1],
APP_TASK_MONITOR_SENS2_PRIO);
/* Start the OS */
OSStart();
/* Should never arrive here */
return 0;
}
示例15: main
/*
*********************************************************************************************************
* main()
*
* Description : This is the standard entry point for C code. It is assumed that your code will call
* main() once you have performed all necessary initialization.
*
* Argument(s) : none.
*
* Return(s) : none.
*
* Caller(s) : This the main standard entry point.
*
* Note(s) : none.
*********************************************************************************************************
*/
int main(void)
{
INT8U err;
BSP_IntDisAll(); /* Disable all interrupts until we are ready to accept them */
App_MemAlloc();
OSInit(); /* Initialize "uC/OS-II, The Real-Time Kernel" */
OSTaskCreateExt((void (*)(void *)) App_TaskStart, /* Create the start task */
(void *) 0,
(OS_STK *)&App_TaskStartStk[APP_CFG_TASK_START_STK_SIZE - 1],
(INT8U ) APP_CFG_TASK_START_PRIO,
(INT16U ) APP_CFG_TASK_START_PRIO,
(OS_STK *)&App_TaskStartStk[0],
(INT32U ) APP_CFG_TASK_START_STK_SIZE,
(void *) 0,
(INT16U )(OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR));
OSTaskNameSet(APP_CFG_TASK_START_PRIO, "Start", &err);
OSStart(); /* Start multitasking (i.e. give control to uC/OS-II) */
}