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


C++ Task_Params_init函数代码示例

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


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

示例1: OffloadM3_init

/*!
 * ======== OffloadM3_init ========
 *
 * Initialize the OffloadM3 module, currently supported only on SysM3
 */
Void OffloadM3_init()
{
    Task_Params taskParams;
    Semaphore_Params mutexParams;

    sysm3ProcId = MultiProc_getId("CORE0");
    if (MultiProc_self() != sysm3ProcId)
        return;

    Semaphore_Params_init(&mutexParams);
    mutexParams.mode = Semaphore_Mode_BINARY;
    module.mutex = Semaphore_create(1, NULL, NULL);

    module.created = FALSE;
    module.semaphores[OFFLOAD_CREATE_IDX] = Semaphore_create(0, NULL, NULL);
    module.semaphores[OFFLOAD_DELETE_IDX] = Semaphore_create(0, NULL, NULL);

    Task_Params_init(&taskParams);
    taskParams.instance->name = "OffloadM3_createTask";
    taskParams.priority = xdc_runtime_knl_Thread_Priority_NORMAL;
    taskParams.arg0 = (UArg)module.semaphores[OFFLOAD_CREATE_IDX];
    module.tasks[OFFLOAD_CREATE_IDX] = Task_create(OffloadM3_createTask, &taskParams, NULL);

    Task_Params_init(&taskParams);
    taskParams.instance->name = "OffloadM3_deleteTask";
    taskParams.priority = xdc_runtime_knl_Thread_Priority_HIGHEST;
    taskParams.arg0 = (UArg)module.semaphores[OFFLOAD_DELETE_IDX];
    module.tasks[OFFLOAD_DELETE_IDX] = Task_create(OffloadM3_deleteTask, &taskParams, NULL);
}
开发者ID:Hashcode,项目名称:sysbios-rpmsg,代码行数:34,代码来源:OffloadM3.c

示例2: smain

/* ARGSUSED */
Void smain(UArg arg0, UArg arg1)
{
    SemThread_Params semParams;
    Task_Params      taskParams;
    Task_Handle      tsk;
    Int              i;

    Log_print0(Diags_ENTRY, "[+E] smain> Enter ");

    SemThread_Params_init(&semParams);
    done = SemThread_create(0, &semParams, NULL);

    SemThread_Params_init(&semParams);
    mutex = SemThread_create(1, &semParams, NULL);

    if ((done == NULL) || (mutex == NULL)) {
        Log_print0(Diags_USER7, "[+7] smain> SemThread creation failed");

        System_abort("SemThread_create failed \n");
    }

    Task_Params_init(&taskParams);
    /*
     *  Add the following line to have the stack allocated from the external
     *  heap:
     *      taskParams.stackHeap = (IHeap_Handle)EXTMEM_HEAP;
     */

    taskParams.stackSize = 0x1000;

    for (i = 0; i < NUMTASKS; i++) {
        Task_Params_init(&taskParams);
        taskParams.priority = attrsTable[i].priority;

        taskParams.arg0 = i + 1; /* task id */
        taskParams.arg1 = i;     /* index into attrsTable */
        tsk = Task_create((Task_FuncPtr)rmanTask, &taskParams, NULL);

        if (tsk == NULL) {

            Log_print1(Diags_USER7, "[+7] smain> Task_create of task %d failed",
                    (IArg)(i + 1));

            System_abort("Task_create() failed\n");
        }
    }

    for (i = 0; i < NUMTASKS; i++) {
        SemThread_pend(done, SemThread_FOREVER, NULL);
    }

    SemThread_delete(&mutex);
    SemThread_delete(&done);

    Log_print0(Diags_USER4, "[+4] smain> TEST PASSED ");

    Log_print0(Diags_EXIT, "[+X] smain> Exit ");
}
开发者ID:andreimironenko,项目名称:framework_components,代码行数:59,代码来源:app.c

示例3: main

/*
 *  ======== main ========
 */
int main()
{
    /* initialize all device/board specific peripherals */
    Board_init();

    Task_Params taskParams;

    System_printf("Startup\n");
    System_flush();

    /* initialize taskParams to the defaults */
    Task_Params_init(&taskParams);

    taskParams.priority = Task_numPriorities - 1;
    taskParams.stackSize = 0x800;

    /* Set the task name */
    taskParams.instance->name = (xdc_String)"hello";

    /* Create the task */
    Task_create(hello_task, &taskParams, NULL);

    /* does not return */
    BIOS_start();

    return (0); /* should never get here, but just in case ... */
}
开发者ID:energia,项目名称:emt,代码行数:30,代码来源:main.cpp

示例4: main

/*
 *  ======== main ========
 */
Void main()
{       
    Swi_Params swiParams;
    Task_Params taskParams;
    Clock_Params clkParams;

    Swi_Params_init(&swiParams);
    swiParams.arg0 = 1;
    swiParams.arg1 = 0;
    swiParams.priority = 2;
    swiParams.trigger = 0;

    swi0 = Swi_create(swi0Fxn, &swiParams, NULL);

    swiParams.arg0 = 2;
    swiParams.arg1 = 0;
    swiParams.priority = 1;
    swiParams.trigger = 3;

    swi1 = Swi_create(swi1Fxn, &swiParams, NULL);

    Task_Params_init(&taskParams);
    taskParams.priority = 1;
    Task_create (tsk0Fxn, &taskParams, NULL);

    Clock_Params_init(&clkParams);
    clkParams.startFlag = TRUE;
    Clock_create(clk0Fxn, 2, &clkParams, NULL);

    sem0 = Semaphore_create(0, NULL, NULL);

    BIOS_start();
}
开发者ID:andreimironenko,项目名称:bios,代码行数:36,代码来源:swi.c

示例5: main

/*
 *  ======== main ========
 */
int main(void)
{
    Task_Params taskParams;

    /* Call board init functions */
    Board_initGeneral();
    Board_initGPIO();
    Board_initSDSPI();

    /* Construct file copy Task thread */
    Task_Params_init(&taskParams);
    taskParams.stackSize = TASKSTACKSIZE;
    taskParams.stack = &task0Stack;
    Task_construct(&task0Struct, (Task_FuncPtr)taskFxn, &taskParams, NULL);

    /* Turn on user LED */
    GPIO_write(Board_LED0, Board_LED_ON);

    System_printf("Starting the FatSD Raw example\n");

    /* Start BIOS */
    BIOS_start();

    return (0);
}
开发者ID:tomaszmat,项目名称:simulate,代码行数:28,代码来源:fatsdraw.c

示例6: netOpenHook

/*
 *  ======== netOpenHook ========
 *  NDK network open hook used to initialize IPv6
 */
void netOpenHook()
{
    Task_Handle taskHandle;
    Task_Params taskParams;
    Error_Block eb;
    int status;
    int dev_index = 1;

    /* Make sure Error_Block is initialized */
    Error_init(&eb);

    status = IPv6InterfaceInit(dev_index, IPv6DADStatus);
    if (status < 0) {
        System_printf("Error %d: failed to add IPv6 interface\n", status);
    }

    /*
     *  Create the Task that handles UDP "connections."
     *  arg0 will be the port that this task listens to. arg1 is the family,
     *  set for IPv6 in this example.
     */
    Task_Params_init(&taskParams);
    taskParams.stackSize = UDPHANDLERSTACK;
    taskParams.priority = 1;
    taskParams.arg0 = UDPPORT;
    taskParams.arg1 = AF_INET6;
    taskHandle = Task_create((Task_FuncPtr)echoFxn, &taskParams, &eb);
    if (taskHandle == NULL) {
        System_printf("Error: Failed to create udpHandler Task\n");
    }
}
开发者ID:DemonTu,项目名称:ALL_SmartBatterySwitch_CC2640,代码行数:35,代码来源:udpEchoHooksIPv6.c

示例7: main

Int main(Int argc, Char* argv[])
{
    Error_Block     eb;
    Task_Params     taskParams;
    Registry_Result result;

    Log_print0(Diags_ENTRY, "--> main:");

    /* must initialize the error block before using it */
    Error_init(&eb);

    /* create main thread (interrupts not enabled in main on BIOS) */
    Task_Params_init(&taskParams);
    taskParams.instance->name = "smain";
    taskParams.stackSize = 0x1000;
    Task_create(smain, &taskParams, &eb);

    if (Error_check(&eb)) {
        System_abort("main: failed to create application startup thread");
    }

    /* register with xdc.runtime to get a diags mask */
    result = Registry_addModule(&Registry_CURDESC, MODULE_NAME);
    Assert_isTrue(result == Registry_SUCCESS, (Assert_Id)NULL);

    /* start scheduler, this never returns */
    BIOS_start();

    /* should never get here */
    Log_print0(Diags_EXIT, "<-- main:");
    return (0);
}
开发者ID:liyaoshi,项目名称:ipcdev,代码行数:32,代码来源:NameServerApp.c

示例8: Error_init

void A110x2500Radio::begin(uint8_t address, channel_t channel, power_t power)
{
  gDataTransmitting = false;
  gDataReceived = false;
  Task_Params taskParams;
  Error_Block eb;
  Error_init(&eb);
  GateMutex_construct(&mygate, NULL);

  sem = Semaphore_create(0, NULL, &eb);
  // Configure the radio and set the default address, channel, and TX power.
  A110LR09Init(&gPhyInfo, &gSpi, gGdo);
  setAddress(address);
  setChannel(channel);
  setPower(power);

  Task_Params_init(&taskParams);
  taskParams.priority = Task_numPriorities - 1;

  taskParams.stackSize = 0x800;
  Task_create(serviceInterrupt, &taskParams, &eb);

  attachInterrupt(RF_GDO0, gdo0Isr, FALLING);
  sleep();
}
开发者ID:ArduCAM,项目名称:Energia,代码行数:25,代码来源:A110x2500Radio.cpp

示例9: BtStack_start

int8_t BtStack_start(void)
{
	if (rxTask != NULL)
	{
		// service already started
		return -1;
	}

	// creating the task
	Task_Params params;
	Task_Params_init(&params);
	params.instance->name = "btStack::rx";
	params.priority = rxPriority;
	params.stackSize = rxStackSize;

	Error_Block eb;
	Error_init(&eb);

	rxTask = Task_create((Task_FuncPtr) rxFxn, &params, &eb);
	if (rxTask == NULL)
	{
		return -2;
	}
	else
	{
		hasStart = TRUE;
		return 0;
	}
}
开发者ID:sudo-g,项目名称:Matilda,代码行数:29,代码来源:BtStack.c

示例10: main

/*
 *  ======== main ========
 */
Int main(Int argc, Char* argv[])
{
    Error_Block     eb;
    Task_Params     taskParams;


    Log_print0(Diags_INFO, LOGSTR(1));

    /* must initialize the error block before using it */
    Error_init(&eb);

    /* create main thread (interrupts not enabled in main on BIOS) */
    Task_Params_init(&taskParams);
    taskParams.instance->name = "smain";
    taskParams.arg0 = (UArg)argc;
    taskParams.arg1 = (UArg)argv;
    taskParams.stackSize = 0x700;
    Task_create(smain, &taskParams, &eb);

    if (Error_check(&eb)) {
        System_abort((String)(LOGSTR(13)));
    }

    /* start scheduler, this never returns */
    BIOS_start();

    /* should never get here */
    return(0);
}
开发者ID:skitlab,项目名称:ti-framework_components,代码行数:32,代码来源:main_server_bios.c

示例11: main

int main(void)
{
    Task_Params taskParams;

    /* Call board init functions */
    Board_initGeneral();
    memoryInit(spiHandle, 6250);
    // Board_initWatchdog();

    /* Construct heartBeat Task  thread */
    Task_Params_init(&taskParams);
    taskParams.arg0 = 1000000 / Clock_tickPeriod;
    taskParams.stackSize = TASKSTACKSIZE;
    taskParams.stack = &task0Stack;
    Task_construct(&task0Struct, (Task_FuncPtr)heartBeatFxn, &taskParams, NULL);

    /* Open LED pins */
    ledPinHandle = PIN_open(&ledPinState, ledPinTable);
    if(!ledPinHandle) {
        System_abort("Error initializing board LED pins\n");
    }

    //IOCPortConfigureSet(PIN_SPI_MOSI, PORTID, PIN-CONFIG); // oklart om och hur denna funkar.
    //IOCPortConfigureSet(DIOn, PORTID, PIN-CONFIG);
    //PIN_setOutputValue(ledPinHandle, Board_LED1, 1);

    /* Start BIOS */
    BIOS_start();

    return (0);
}
开发者ID:ponjoh90,项目名称:exjobb_pontus_fredrik,代码行数:31,代码来源:empty_min.c

示例12: SetupUartTask

/**
 * /fn SetupUartTask
 * /brief Setup UART tasks.
 *
 * Task has priority 15 and receives 1kB of stack.
 *
 * /return Always 0. In case of error the system halts.
 */
int SetupUartTask(void) {
	Task_Params taskTransferParams;
	Task_Handle taskTransfer;
	Error_Block eb;

	/* Enable and configure the peripherals used by the UART7 */
	SysCtlPeripheralEnable(GPIO_PORTC_BASE);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_UART7);
	GPIOPinConfigure(GPIO_PC4_U7RX);
	GPIOPinConfigure(GPIO_PC5_U7TX);
	GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_4 | GPIO_PIN_5);

	/* Enable and configure the peripherals used by the UART6 */
	SysCtlPeripheralEnable(GPIO_PORTP_BASE);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_UART6);
	GPIOPinConfigure(GPIO_PP0_U6RX);
	GPIOPinConfigure(GPIO_PP1_U6TX);
	GPIOPinTypeUART(GPIO_PORTP_BASE, GPIO_PIN_0 | GPIO_PIN_1);

	UART_init();

	InitializeLedUserSwitch();

	Error_init(&eb);
	Task_Params_init(&taskTransferParams);
	taskTransferParams.stackSize = 1024;
	taskTransferParams.priority = 15;
	taskTransfer = Task_create((Task_FuncPtr) TransferFunction,
			&taskTransferParams, &eb);
	if (taskTransfer == NULL) {
		System_abort("UART task create failed");
	}

	return (0);
}
开发者ID:Komisa72,项目名称:ese_wheaterstation_2016,代码行数:43,代码来源:UART_Task.c

示例13: main

Int main(Int argc, Char* argv[])
{
    Error_Block eb;
    Task_Params taskParams;


    Log_print3(Diags_ENTRY,
        "--> %s: (argc: %d, argv: 0x%x)", (IArg)FXNN, (IArg)argc, (IArg)argv);

    /* must initialize the error block before using it */
    Error_init(&eb);

    /* initialize ipc layer */
    Ipc_start();

    /* create main thread (interrupts not enabled in main on BIOS) */
    Task_Params_init(&taskParams);
    taskParams.instance->name = "AppMain_main__P";
    taskParams.arg0 = (UArg)argc;
    taskParams.arg1 = (UArg)argv;
    taskParams.stackSize = 0x4000;
    Task_create(AppMain_main__P, &taskParams, &eb);

    if (Error_check(&eb)) {
        System_abort("main() failed to create application startup thread");
    }

    /* start scheduler, this never returns */
    BIOS_start();
    
    /* should never get here */
    Log_print1(Diags_EXIT, "<-- %s: should never get here", (IArg)FXNN);
    return(0);
}
开发者ID:andreimironenko,项目名称:framework_components,代码行数:34,代码来源:main_BIOS.c

示例14: netOpenHook

void netOpenHook(UArg uarg0)
{
	Task_Handle taskHandle;
	Task_Params taskParams;
	Error_Block eb;

	/* Make sure Error_Block is initialized */
	Error_init(&eb);

	/*
	 *  Create the Task that farms out incoming TCP connections.
	 *  arg0 will be the port that this task listens to.
	 */
	Task_Params_init(&taskParams);
	taskParams.stackSize = UDPHANDLERSTACK;
	taskParams.priority = 1;
	taskParams.arg0 = UDPPORT;
	//mbox
	taskParams.arg1 = uarg0;
	taskHandle = Task_create((Task_FuncPtr)udpHandler, &taskParams, &eb);
	if (taskHandle == NULL) {
		System_printf("netOpenHook: Failed to create tcpHandler Task\n");
	}

	System_flush();
}
开发者ID:droptableuser,项目名称:embsysengineering,代码行数:26,代码来源:udp.c

示例15: main

/*
 *  ======== main ========
 */
int main(void)
{
    Task_Params taskParams;

    /* Call board init functions */
    Board_initGeneral();
    Board_initGPIO();
    // Board_initI2C();
    // Board_initSDSPI();
    // Board_initSPI();
    // Board_initUART();
    // Board_initUSB(Board_USBDEVICE);
    // Board_initWatchdog();
    // Board_initWiFi();

    /* Construct heartBeat Task  thread */
    Task_Params_init(&taskParams);
    taskParams.arg0 = 1000;
    taskParams.stackSize = TASKSTACKSIZE;
    taskParams.stack = &task0Stack;
    Task_construct(&task0Struct, (Task_FuncPtr)heartBeatFxn, &taskParams, NULL);

    /* Turn on user LED */
    GPIO_write(Board_LED0, Board_LED_ON);

    System_printf("Starting the example\nSystem provider is set to SysMin. "
                  "Halt the target to view any SysMin contents in ROV.\n");
    /* SysMin will only print to the console when you call flush or exit */
    System_flush();

    /* Start BIOS */
    BIOS_start();

    return (0);
}
开发者ID:tomaszmat,项目名称:simulate,代码行数:38,代码来源:empty.c


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