当前位置: 首页>>代码示例>>C++>>正文


C++ OSTaskNameSet函数代码示例

本文整理汇总了C++中OSTaskNameSet函数的典型用法代码示例。如果您正苦于以下问题:C++ OSTaskNameSet函数的具体用法?C++ OSTaskNameSet怎么用?C++ OSTaskNameSet使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了OSTaskNameSet函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AppTaskCreate

static  void  AppTaskCreate (void)
{
	if (DEBUG)
			xil_printf("DEBUG: INSIDE AppTaskCreate\n\r");

	CPU_INT08U err;
	
	/* Crea la segunda tarea de la aplicación */
	OSTaskCreateExt(AppTaskSecond,
                   (void *)0,
                   &AppTaskSecondStk[APP_TASK_SECOND_STK_SIZE - 1],
                   APP_TASK_SECOND_PRIO,
                   APP_TASK_SECOND_ID,
                   &AppTaskSecondStk[0],
                   APP_TASK_SECOND_STK_SIZE,
                   (void *)0,
                   OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);
    OSTaskNameSet(APP_TASK_SECOND_PRIO, (CPU_INT08U *)"App Task Second", &err);
	
	/* Crea la segunda tarea de la aplicación */
	OSTaskCreateExt(AppTaskUART,
                   (void *)0,
                   &AppTaskUARTStk[APP_TASK_UART_STK_SIZE - 1],
                   APP_TASK_UART_PRIO,
                   APP_TASK_UART_ID,
                   &AppTaskUARTStk[0],
                   APP_TASK_UART_STK_SIZE,
                   (void *)0,
                   OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);
    OSTaskNameSet(APP_TASK_UART_PRIO, (CPU_INT08U *)"App Task UART", &err);
}
开发者ID:fquinto,项目名称:Wireless_sensor_network,代码行数:31,代码来源:application.c

示例2: AppTaskCreate

static  void  AppTaskCreate (void)
{
    CPU_INT08U  err;


    OSTaskCreateExt(AppTask1,                                           /* Create start task 1                                      */
                    (void *)0,
                    (OS_STK *)&AppTask1Stk[APP_TASK1_STK_SIZE - 1],
                    APP_START_TASK1_PRIO,
                    APP_START_TASK1_PRIO,
                    (OS_STK *)&AppTask1Stk[0],
                    APP_TASK1_STK_SIZE,
                    (void *)0,
                    OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);

#if OS_TASK_NAME_SIZE > 7
    OSTaskNameSet(APP_START_TASK1_PRIO, (CPU_CHAR *)"Task 1", &err);
#endif

    OSTaskCreateExt(AppTask2,                                           /* Create start task 1                                      */
                    (void *)0,
                    (OS_STK *)&AppTask2Stk[APP_TASK2_STK_SIZE - 1],
                    APP_START_TASK2_PRIO,
                    APP_START_TASK2_PRIO,
                    (OS_STK *)&AppTask2Stk[0],
                    APP_TASK2_STK_SIZE,
                    (void *)0,
                    OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);

#if OS_TASK_NAME_SIZE > 7
    OSTaskNameSet(APP_START_TASK1_PRIO, (CPU_CHAR *)"Task 2", &err);
#endif
}
开发者ID:Vanganesha,项目名称:oufffteam,代码行数:33,代码来源:app.c

示例3: main

void main(int argc, char *argv[])
{
	INT8U  err;


#if 0
    BSP_IntDisAll();                       /* For an embedded target, disable all interrupts until we are ready to accept them */
#endif

    OSInit();                              /* Initialize "uC/OS-II, The Real-Time Kernel"                                      */
	sysinit();
	OSTaskCreate(AppStartTask,(void *)0,(OS_STK *)&AppStartTaskStk[0][TASK_STK_SIZE-1],2);
	OSTaskCreate(test2,		  (void *)0,(OS_STK *)&AppStartTaskStk[1][TASK_STK_SIZE-1],3);
	OSTaskCreate(test3,		  (void *)0,(OS_STK *)&AppStartTaskStk[2][TASK_STK_SIZE-1],4);
	OSTaskCreate(getStr,	  (void *)0,(OS_STK *)&AppStartTaskStk[3][TASK_STK_SIZE-1],5);

#if OS_TASK_NAME_SIZE > 11
    OSTaskNameSet(APP_TASK_START_PRIO, (INT8U *)"Start Task", &err);
#endif

#if OS_TASK_NAME_SIZE > 14
    OSTaskNameSet(OS_IDLE_PRIO, (INT8U *)"uC/OS-II Idle", &err);
#endif

#if (OS_TASK_NAME_SIZE > 14) && (OS_TASK_STAT_EN > 0)
    OSTaskNameSet(OS_STAT_PRIO, "uC/OS-II Stat", &err);
#endif

    OSStart();                             /* Start multitasking (i.e. give control to uC/OS-II)                               */
}
开发者ID:writeing,项目名称:Qt-ucos-TCPforUsart,代码行数:30,代码来源:main.c

示例4: 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;
}
开发者ID:dustcloud,项目名称:onchipsdk,代码行数:62,代码来源:uart_app.c

示例5: 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
}
开发者ID:wangdongqqqq,项目名称:123,代码行数:58,代码来源:probe_rs232_os.c

示例6: 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
}
开发者ID:AndreMiras,项目名称:EFM32-Library,代码行数:70,代码来源:app.c

示例7: 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);
}
开发者ID:wjw890912,项目名称:Power-measurement,代码行数:55,代码来源:app.c

示例8: 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;
}
开发者ID:Manish-cimcon,项目名称:micro,代码行数:53,代码来源:os_probe.c

示例9: 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    */
}
开发者ID:voileravi,项目名称:zen,代码行数:51,代码来源:TEST.C

示例10: 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
}
开发者ID:Azaddien,项目名称:simulator-for-quadcopter,代码行数:51,代码来源:os_tmr.c

示例11: main

int  main (void)
{
    CPU_INT08U  os_err;
    /* Disable all ints until we are ready to accept them. */
    BSP_IntDisAll();                                            
    /* Initialize "uC/OS-II, The Real-Time Kernel".*/
    OSInit();                                                   
    /* Create the start task.*/
    os_err = OSTaskCreateExt((void (*)(void *)) App_TaskStart,  
                             (void          * ) 0,
                             (OS_STK        * )&App_TaskStartStk[APP_TASK_START_STK_SIZE - 1],
                             (INT8U           ) APP_TASK_START_PRIO,
                             (INT16U          ) APP_TASK_START_PRIO,
                             (OS_STK        * )&App_TaskStartStk[0],
                             (INT32U          ) APP_TASK_START_STK_SIZE,
                             (void          * )0,
                             (INT16U          )(OS_TASK_OPT_STK_CLR | OS_TASK_OPT_STK_CHK));

#if (OS_TASK_NAME_SIZE >= 11)
    OSTaskNameSet(APP_TASK_START_PRIO, (CPU_INT08U *)"Start Task", &os_err);
#endif
    /* Start multitasking (i.e. give control to uC/OS-II).*/
    OSStart();                                                  

    return (0);
}
开发者ID:nhaberla,项目名称:stm32f4,代码行数:26,代码来源:app.c

示例12: main

int  main (void)
{
#if (OS_TASK_NAME_SIZE > 7) && (OS_TASK_STAT_EN > 0)
    CPU_INT08U  err;
#endif

	// Add delay to ensure EXTBT module is correctly reset.
#if UC3C
	cpu_delay_ms(AVR32_SCIF_RCOSC_FREQUENCY, 1000);
#else
        cpu_delay_ms(AVR32_PM_RCOSC_FREQUENCY, 1000);
#endif

	CPU_IntDis(); /*Disable all interrupts */

  	sysclk_init();

	OSInit();

	OSTaskCreateExt(app_task,(void *)0,
		(OS_STK *)&AppTaskStk[APP_TASK_STK_SIZE-1], APP_TASK_START_PRIO,
		APP_TASK_START_PRIO,(OS_STK *)&AppTaskStk[0], APP_TASK_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();

	return (0);
}
开发者ID:Mazetti,项目名称:asf,代码行数:32,代码来源:main.c

示例13: thread

/*
  Starts a new thread with priority "prio" that will begin its execution in the
  function "thread()". The "arg" argument will be passed as an argument to the
  thread() function. The id of the new thread is returned. Both the id and
  the priority are system dependent.
*/
sys_thread_t sys_thread_new(char *name, void (* thread)(void *arg), void *arg, int stacksize, int prio)
{
    u8_t ubPrio = 0;
    u8_t ucErr;
    
    arg = arg;
    
    if((prio > 0) && (prio <= LWIP_TASK_MAX))
    {
        ubPrio = (u8_t)(LWIP_START_PRIO + prio - 1);

        if(stacksize > LWIP_STK_SIZE)   /* 任务堆栈大小不超过LWIP_STK_SIZE */
            stacksize = LWIP_STK_SIZE;
        
#if (OS_TASK_STAT_EN == 0)
        OSTaskCreate(thread, (void *)arg, &LWIP_TASK_STK[prio-1][stacksize-1],ubPrio);
#else
        OSTaskCreateExt(thread, (void *)arg, &LWIP_TASK_STK[prio-1][stacksize-1],ubPrio
                        ,ubPrio,&LWIP_TASK_STK[prio-1][0],stacksize,(void *)0,OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);
#endif
        OSTaskNameSet(ubPrio, (u8_t*)name, &ucErr);
        
    }
        return ubPrio;
}
开发者ID:linab309,项目名称:stm32_hdcp_12,代码行数:31,代码来源:sys_arch.c

示例14: 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)       */
}
开发者ID:wangjianghua,项目名称:gas-flow-meter,代码行数:41,代码来源:main.c

示例15: main

int main(void)
{	
	uint8_t os_err;
	
	__disable_irq(); //禁止所有中断。
	
	OSInit(); //初始化uC/OS-II这个实时内核。

	os_err = OSTaskCreateExt((void (*)(void *)) App_Task0, //创建一个开始任务。
                             (void          * ) 0,
                             (OS_STK        * )&App_Task0Stack[APP_TASK0_STK_SIZE - 1],
                             (uint8_t         ) APP_TASK0_PRIO,
                             (uint16_t        ) APP_TASK0_PRIO,
                             (OS_STK        * )&App_Task0Stack[0],
                             (INT32U          ) APP_TASK0_STK_SIZE,
                             (void          * )0,
                             (uint16_t        )(OS_TASK_OPT_STK_CLR | OS_TASK_OPT_STK_CHK));
	if(os_err == OS_ERR_NONE)
	{
		OSTaskNameSet(APP_TASK0_PRIO, (uint8_t *)"Start Task", &os_err); //给开始任务命名。
	}
	
    OSStart(); //开始UCOS内核。
	
	return 0;
}
开发者ID:nosnav,项目名称:stm32f4-uCos-II-mdk-fpu-template-project,代码行数:26,代码来源:main.c


注:本文中的OSTaskNameSet函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。