这篇教程C++ vTaskPrioritySet函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中vTaskPrioritySet函数的典型用法代码示例。如果您正苦于以下问题:C++ vTaskPrioritySet函数的具体用法?C++ vTaskPrioritySet怎么用?C++ vTaskPrioritySet使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了vTaskPrioritySet函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ETHERNET_Cleanup/** * @brief Clean up th ethernet services and free resources * @param None * @retval None */static void ETHERNET_Cleanup(void){ EthernetSettings.DistantControlEnabled = 0; EthernetSettings.BackgroundEnabled = 0; EthernetSettings.InitDone = 0; ETH_Stop(); vTaskPrioritySet(Task_Handle, (configMAX_PRIORITIES - 1)); if(ETH_Task_Handle != NULL) { vTaskDelete(ETH_Task_Handle); ETH_Task_Handle = NULL; } vQueueDelete( Ethernet_xSemaphore ); Ethernet_xSemaphore = NULL; if(TCPIP_Task_Handle != NULL) { vTaskSuspend(TCPIP_Task_Handle); } if(HTTP_Task_Handle != NULL) { vTaskDelete(HTTP_Task_Handle); HTTP_Task_Handle = NULL; } if(DHCP_Task_Handle != NULL) { vTaskDelete(DHCP_Task_Handle); DHCP_Task_Handle = NULL; } netif_remove(&xnetif);}
开发者ID:denisweir,项目名称:STM32F40X,代码行数:39,
示例2: MPU_vTaskPrioritySet void MPU_vTaskPrioritySet( xTaskHandle pxTask, unsigned portBASE_TYPE uxNewPriority ) { portBASE_TYPE xRunningPrivileged = prvRaisePrivilege(); vTaskPrioritySet( pxTask, uxNewPriority ); portRESET_PRIVILEGE( xRunningPrivileged ); }
开发者ID:bookie,项目名称:freertos,代码行数:7,
示例3: MPU_vTaskPrioritySet void MPU_vTaskPrioritySet( TaskHandle_t pxTask, UBaseType_t uxNewPriority ) { BaseType_t xRunningPrivileged = xPortRaisePrivilege(); vTaskPrioritySet( pxTask, uxNewPriority ); vPortResetPrivilege( xRunningPrivileged ); }
开发者ID:sean93park,项目名称:freertos,代码行数:7,
示例4: MPU_vTaskPrioritySetvoid MPU_vTaskPrioritySet( TaskHandle_t pxTask, UBaseType_t uxNewPriority ){ BaseType_t xRunningPrivileged = prvRaisePrivilege(); vTaskPrioritySet( pxTask, uxNewPriority ); portRESET_PRIVILEGE( xRunningPrivileged );}
开发者ID:RitikaGupta1207,项目名称:freertos,代码行数:7,
示例5: OsThreadCreateTHandle OsThreadCreate(const char* aName, uint32_t aPriority, uint32_t aStackBytes, ThreadEntryPoint aEntryPoint, void* aArg){ portBASE_TYPE result; xTaskHandle task; /* The task application tag is used to hold a pointer to the containing Thread object. If the child task is higher priority than it's parent, it'll run before the tag is set. Bad. So we set the initial priority as slightly lower than parent thread, set the tag, then promote the child task to it's rightful priority. */ result = xTaskCreate( aEntryPoint, // pdTASK_CODE pvTaskCode, (const signed char * const) aName, // const portCHAR * const pcName, (aStackBytes != 0 ? aStackBytes : 1024 * 32) / sizeof( portSTACK_TYPE ), // unsigned portSHORT usStackDepth, aArg, // void *pvParameters, uxTaskPriorityGet(NULL) - 1, // unsigned portBASE_TYPE uxPriority, &task // xTaskHandle *pvCreatedTask ); if ( result != pdPASS ) return kHandleNull; vTaskSetApplicationTaskTag(task, aArg); vTaskPrioritySet(task, aPriority); return (THandle) task;}
开发者ID:astaykov,项目名称:ohNet,代码行数:27,
示例6: vTask2void vTask2(void* pvParameters){ UBaseType_t uxPriority; // Task 1will always run before this task as Task 1 is created with the // higher priority. Neither Task 1 nor Task 2 ever block so will always be // in either the Running or the Ready state. // Query the priority at which this task is running - passing in NULL means // "return my priority". uxPriority = uxTaskPriorityGet(NULL); for (;;) { // For this task to reach this point Task 1 must have already run and // set the priority of this task higher than its own. // Print out the name of this task. printf("Task2 is running/n"); fflush(stdout); // Set our priority back down to its original value. Passing in NULL // as the task handle means "change my priority". Setting the priority // below that of Task 1 will cause Task 1 to immediately start running // again - pre-empting this task. printf("About to lower the Task 2 priority/n"); fflush(stdout); vTaskPrioritySet(NULL, uxPriority-2); }}
开发者ID:hokim72,项目名称:FreeRTOS,代码行数:30,
示例7: vStartupLEDTaskvoid vStartupLEDTask ( void *pvParameters ) { vLEDSet(D2_PORT, D2_PIN, ON); vLEDSet(D3_PORT, D3_PIN, ON); vLEDSet(D4_PORT, D4_PIN, ON); vTaskDelay(500/portTICK_RATE_MS); vLEDSet(D2_PORT, D2_PIN, OFF); vLEDSet(D3_PORT, D3_PIN, OFF); vLEDSet(D4_PORT, D4_PIN, OFF); xTaskCreate( vLEDFlashTask, ( signed portCHAR * ) "LEDf", configMINIMAL_STACK_SIZE , NULL, tskIDLE_PRIORITY+2, NULL); // printf("LEDStartup HWM = %d1/r/n", uxTaskGetStackHighWaterMark(NULL)); vTaskDelete(NULL); for (;;) { //Should never get here vTaskPrioritySet(NULL, tskIDLE_PRIORITY); // printf("LcdStartup Still Running/r/n"); }}
开发者ID:Dzenik,项目名称:stm32_freertos_example,代码行数:30,
示例8: vTask1void vTask1(void* pvParameters){ UBaseType_t uxPriority; // This task will always run before Task2 as it is created with the higher // priority. Neither Task1 nor Task2 ever block so both will always be // in either the Running or the Ready state. // Query the priority at which this task is running - passing in NULL means // "return my priority". uxPriority = uxTaskPriorityGet(NULL); for (;;) { // Print out the name of this task. vTaskSuspendAll(); printf("Task 1 is running/n"); fflush(stdout); xTaskResumeAll(); // Setting the Task 2 priority above the Task 1 priority will cause // Task2 to immediately start running (as then Task 2 will have the // higher priority of the two created tasks). Note the use of the handle // to task 2 (xTask2Handle) in the call to vTaskPrioritySet(). // main() shows how the handle was obtained. printf("About to raise the Task 2 priority/n"); fflush(stdout); vTaskPrioritySet(xTask2Handle, uxPriority+1); // Task 1 will only run when it has a priority higher than Task 2. // Therefore, for this task to reach this point Task2 must already // have executed and set its priority back down to below the priority // of this task. }}
开发者ID:hokim72,项目名称:FreeRTOS,代码行数:35,
示例9: low_level_init/** * /brief In this function, the hardware should be initialized. * Called from ethernetif_init(). * * /param netif the already initialized lwip network interface structure * for this ethernetif */static void low_level_init(struct netif *netif){#ifdef FREERTOS_USED unsigned portBASE_TYPE uxPriority;#endif /* Set MAC hardware address length */ netif->hwaddr_len = sizeof(gs_uc_mac_address); /* Set MAC hardware address */ netif->hwaddr[0] = gs_uc_mac_address[0]; netif->hwaddr[1] = gs_uc_mac_address[1]; netif->hwaddr[2] = gs_uc_mac_address[2]; netif->hwaddr[3] = gs_uc_mac_address[3]; netif->hwaddr[4] = gs_uc_mac_address[4]; netif->hwaddr[5] = gs_uc_mac_address[5]; /* Maximum transfer unit */ netif->mtu = NET_MTU; /* Configure EMAC pins */// ethPinsInit(); /* gpio_configure_pin(PIN_EEMAC_EREFCK, PIN_EMAC_FLAGS); gpio_configure_pin(PIN_EMAC_ETX0, PIN_EMAC_FLAGS); gpio_configure_pin(PIN_EMAC_ETX1, PIN_EMAC_FLAGS); gpio_configure_pin(PIN_EMAC_ETXEN, PIN_EMAC_FLAGS); gpio_configure_pin(PIN_EMAC_ECRSDV, PIN_EMAC_FLAGS); gpio_configure_pin(PIN_EMAC_ERX0, PIN_EMAC_FLAGS); gpio_configure_pin(PIN_EMAC_ERX1, PIN_EMAC_FLAGS); gpio_configure_pin(PIN_EMAC_ERXER, PIN_EMAC_FLAGS); gpio_configure_pin(PIN_EMAC_EMDC, PIN_EMAC_FLAGS); gpio_configure_pin(PIN_EMAC_EMDIO, PIN_EMAC_FLAGS); */ /* device capabilities */ /* don't set NETIF_FLAG_ETHARP if this device is not an ethernet one */ netif->flags |= NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP#if defined(DHCP_USED) | NETIF_FLAG_DHCP#endif ; netif->flags |= NETIF_FLAG_LINK_UP; //the link is up? //printf("netif->flags %X /n", netif->flags);#ifdef FREERTOS_USED /* * NOTE: This routine contains code that polls status bits. If the Ethernet * cable is not plugged in then this can take a considerable time. To prevent * this from starving lower priority tasks of processing time we lower our * priority prior to the call, then raise it back again once the initialization * is complete. */ /* Read the priority of the current task. */ uxPriority = uxTaskPriorityGet( NULL ); /* Set the priority of the current task to the lowest possible. */ vTaskPrioritySet( NULL, tskIDLE_PRIORITY );#endif}
开发者ID:DannyGH,项目名称:RepRapFirmware,代码行数:67,
示例10: low_level_init/** * In this function, the hardware should be initialized. * Called from ethernetif_init(). * * @param netif the already initialized lwip network interface structure * for this ethernetif */static voidlow_level_init(struct netif *netif){ unsigned portBASE_TYPE uxPriority; /* set MAC hardware address length */ netif->hwaddr_len = ETHARP_HWADDR_LEN; /* set MAC hardware address */ netif->hwaddr[0] = ETHERNET_CONF_ETHADDR0; netif->hwaddr[1] = ETHERNET_CONF_ETHADDR1; netif->hwaddr[2] = ETHERNET_CONF_ETHADDR2; netif->hwaddr[3] = ETHERNET_CONF_ETHADDR3; netif->hwaddr[4] = ETHERNET_CONF_ETHADDR4; netif->hwaddr[5] = ETHERNET_CONF_ETHADDR5; /* maximum transfer unit */ netif->mtu = 1500; /* device capabilities */ /* don't set NETIF_FLAG_ETHARP if this device is not an ethernet one */ netif->flags |= NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP; /* Do whatever else is needed to initialize interface. */ /* Initialise the MACB. */ // NOTE: This routine contains code that polls status bits. If the Ethernet // cable is not plugged in then this can take a considerable time. To prevent // this from starving lower priority tasks of processing time we lower our // priority prior to the call, then raise it back again once the initialization // is complete. // Read the priority of the current task. uxPriority = uxTaskPriorityGet( NULL ); // Set the priority of the current task to the lowest possible. vTaskPrioritySet( NULL, tskIDLE_PRIORITY ); // Init the MACB interface. while( xMACBInit(&AVR32_MACB) == FALSE ) { __asm__ __volatile__ ( "nop" ); } // Restore the priority of the current task. vTaskPrioritySet( NULL, uxPriority ); /* Create the task that handles the MACB input packets. */ sys_thread_new( "ETHINT", ethernetif_input, netif, netifINTERFACE_TASK_STACK_SIZE, netifINTERFACE_TASK_PRIORITY );}
开发者ID:garlicnation,项目名称:zwave,代码行数:54,
示例11: prvChangeRelativePrioritiesstatic void prvChangeRelativePriorities( void ){static unsigned portBASE_TYPE ulLoops = 0;static eRelativePriorities ePriorities = eEqualPriority; /* Occasionally change the task priority relative to the priority of the receiving task. */ ulLoops++; if( ulLoops >= queuesetPRIORITY_CHANGE_LOOPS ) { ulLoops = 0; switch( ePriorities ) { case eEqualPriority: /* Both tasks are running with medium priority. Now lower the priority of the receiving task so the Tx task has the higher relative priority. */ vTaskPrioritySet( xQueueSetReceivingTask, queuesetLOW_PRIORITY ); ePriorities = eTxHigherPriority; break; case eTxHigherPriority: /* The Tx task is running with a higher priority than the Rx task. Switch the priorities around so the Rx task has the higher relative priority. */ vTaskPrioritySet( xQueueSetReceivingTask, queuesetMEDIUM_PRIORITY ); vTaskPrioritySet( xQueueSetSendingTask, queuesetLOW_PRIORITY ); ePriorities = eTxLowerPriority; break; case eTxLowerPriority: /* The Tx task is running with a lower priority than the Rx task. Make the priorities equal again. */ vTaskPrioritySet( xQueueSetSendingTask, queuesetMEDIUM_PRIORITY ); ePriorities = eEqualPriority; /* When both tasks are using a non-idle priority the queue set tasks will starve idle priority tasks of execution time - so relax a bit before the next iteration to minimise the impact. */ vTaskDelay( queuesetTX_LOOP_DELAY ); break; } }}
开发者ID:RitikaGupta1207,项目名称:freertos,代码行数:46,
示例12: osThreadSetPriority/*** @brief Change priority of an active thread.* @param thread_id thread ID obtained by /ref osThreadCreate or /ref osThreadGetId.* @param priority new priority value for the thread function.* @retval status code that indicates the execution status of the function.* @note MUST REMAIN UNCHANGED: /b osThreadSetPriority shall be consistent in every CMSIS-RTOS.*/osStatus osThreadSetPriority (osThreadId thread_id, osPriority priority){#if (INCLUDE_vTaskPrioritySet == 1) vTaskPrioritySet(thread_id, makeFreeRtosPriority(priority)); return osOK;#else return osErrorOS;#endif}
开发者ID:Casa2011,项目名称:devices,代码行数:16,
示例13: prvBasicDelayTestsstatic void prvBasicDelayTests( void ){TickType_t xPreTime, xPostTime, x, xLastUnblockTime, xExpectedUnblockTime;const TickType_t xPeriod = 75, xCycles = 5, xAllowableMargin = ( bktALLOWABLE_MARGIN >> 1 ); /* Temporarily increase priority so the timing is more accurate, but not so high as to disrupt the timer tests. */ vTaskPrioritySet( NULL, configTIMER_TASK_PRIORITY - 1 ); /* Crude check to too that vTaskDelay() blocks for the expected period. */ xPreTime = xTaskGetTickCount(); vTaskDelay( bktTIME_TO_BLOCK ); xPostTime = xTaskGetTickCount(); /* The priority is higher, so the allowable margin is halved when compared to the other tests in this file. */ if( ( xPostTime - xPreTime ) > ( bktTIME_TO_BLOCK + xAllowableMargin ) ) { xErrorOccurred = pdTRUE; } /* Now crude tests to check the vTaskDelayUntil() functionality. */ xPostTime = xTaskGetTickCount(); xLastUnblockTime = xPostTime; for( x = 0; x < xCycles; x++ ) { /* Calculate the next expected unblock time from the time taken before this loop was entered. */ xExpectedUnblockTime = xPostTime + ( x * xPeriod ); vTaskDelayUntil( &xLastUnblockTime, xPeriod ); if( ( xTaskGetTickCount() - xExpectedUnblockTime ) > ( bktTIME_TO_BLOCK + xAllowableMargin ) ) { xErrorOccurred = pdTRUE; } xPrimaryCycles++; } /* Reset to the original task priority ready for the other tests. */ vTaskPrioritySet( NULL, bktPRIMARY_PRIORITY );}
开发者ID:Ouss4,项目名称:freertos,代码行数:44,
示例14: prvQueueSetSendingTaskstatic void prvQueueSetSendingTask( void *pvParameters ){unsigned long ulTaskTxValue = 0;portBASE_TYPE xQueueToWriteTo;xQueueHandle xQueueInUse;unsigned portBASE_TYPE uxPriority = queuesetMEDIUM_PRIORITY, ulLoops = 0; /* Remove compiler warning about the unused parameter. */ ( void ) pvParameters; srand( ( unsigned int ) &ulTaskTxValue ); for( ;; ) { /* Generate the index for the queue to which a value is to be sent. */ xQueueToWriteTo = rand() % queuesetNUM_QUEUES_IN_SET; xQueueInUse = xQueues[ xQueueToWriteTo ]; /* Note which index is being written to to ensure all the queues are used. */ ( ulQueueUsedCounter[ xQueueToWriteTo ] )++; /* Send to the queue to unblock the task that is waiting for data to arrive on a queue within the queue set to which this queue belongs. */ if( xQueueSendToBack( xQueueInUse, &ulTaskTxValue, portMAX_DELAY ) != pdPASS ) { /* The send should always pass as an infinite block time was used. */ xQueueSetTasksStatus = pdFAIL; } ulTaskTxValue++; /* If the Tx value has reached the range used by the ISR then set it back to 0. */ if( ulTaskTxValue == queuesetINITIAL_ISR_TX_VALUE ) { ulTaskTxValue = 0; } /* Occasionally change the task priority relative to the priority of the receiving task. */ ulLoops++; if( ulLoops >= queuesetPRIORITY_CHANGE_LOOPS ) { ulLoops = 0; uxPriority++; if( uxPriority > queuesetHIGH_PRIORITY ) { uxPriority = queuesetLOW_PRIORITY; } vTaskPrioritySet( NULL, uxPriority ); } }}
开发者ID:InSoonPark,项目名称:FreeRTOS,代码行数:56,
示例15: SC_check_and_show_connection_infostatic int SC_check_and_show_connection_info(void){ rtw_wifi_setting_t setting; int ret = -1; /* If not rise priority, LwIP DHCP may timeout */ vTaskPrioritySet(NULL, tskIDLE_PRIORITY + 3); /* Start DHCP Client */ ret = LwIP_DHCP(0, DHCP_START); vTaskPrioritySet(NULL, tskIDLE_PRIORITY + 1); wifi_get_setting(WLAN0_NAME, &setting); wifi_show_setting(WLAN0_NAME, &setting); if (ret == DHCP_ADDRESS_ASSIGNED) return SC_SUCCESS; else return SC_DHCP_FAIL;}
开发者ID:geliang201201,项目名称:RTL_Ameba,代码行数:19,
示例16: low_level_initstatic void low_level_init( struct netif *netif ){unsigned portBASE_TYPE uxPriority; /* set MAC hardware address length */ netif->hwaddr_len = 6; /* set MAC hardware address */ netif->hwaddr[0] = emacETHADDR0; netif->hwaddr[1] = emacETHADDR1; netif->hwaddr[2] = emacETHADDR2; netif->hwaddr[3] = emacETHADDR3; netif->hwaddr[4] = emacETHADDR4; netif->hwaddr[5] = emacETHADDR5; /* maximum transfer unit */ netif->mtu = netifMTU; /* broadcast capability */ netif->flags = NETIF_FLAG_BROADCAST; xNetIf = netif; /* Initialise the EMAC. This routine contains code that polls status bits. If the Ethernet cable is not plugged in then this can take a considerable time. To prevent this starving lower priority tasks of processing time we lower our priority prior to the call, then raise it back again once the initialisation is complete. */ uxPriority = uxTaskPriorityGet( NULL ); vTaskPrioritySet( NULL, tskIDLE_PRIORITY ); while( xEMACInit() == NULL ) { __asm( "NOP" ); } vTaskPrioritySet( NULL, uxPriority ); /* Create the task that handles the EMAC. */ xTaskCreate( ethernetif_input, "ETH_INT", netifINTERFACE_TASK_STACK_SIZE, NULL, netifINTERFACE_TASK_PRIORITY, NULL );}
开发者ID:AldenHiggins,项目名称:ELEC424-Lab06-Scheduling-with-FreeRTOS,代码行数:39,
示例17: portTASK_FUNCTION/* * Just keep counting the shared variable up. The control task will suspend * this task when it wants. */static portTASK_FUNCTION( vContinuousIncrementTask, pvParameters ){unsigned long *pulCounter;unsigned portBASE_TYPE uxOurPriority; /* Take a pointer to the shared variable from the parameters passed into the task. */ pulCounter = ( unsigned long * ) pvParameters; /* Query our priority so we can raise it when exclusive access to the shared variable is required. */ uxOurPriority = uxTaskPriorityGet( NULL ); for( ;; ) { /* Raise our priority above the controller task to ensure a context switch does not occur while we are accessing this variable. */ vTaskPrioritySet( NULL, uxOurPriority + 1 ); ( *pulCounter )++; vTaskPrioritySet( NULL, uxOurPriority ); }}
开发者ID:ECEEmbedded,项目名称:ARMCodeRichardMS3,代码行数:26,
示例18: real_timevoid real_time(void * pvParameters){int x=pvParameters;int i; while(1) { i=0; //if(x<6) printk(KERN_ALERT "REAL TIME TASK %d/n",x); while(i++<1000000); //do some computation that ends before deadline vTimerStop(NULL); vTaskPrioritySet(NULL,2); //go back to the scheduler }}
开发者ID:RushangKaria,项目名称:FreeRTOS2,代码行数:17,
|