您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ vTaskSuspend函数代码示例

51自学网 2021-06-03 09:31:52
  C++
这篇教程C++ vTaskSuspend函数代码示例写得很实用,希望能帮到您。

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

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

示例1: prvRecursiveMutexBlockingTask

static void prvRecursiveMutexBlockingTask( void *pvParameters ){	/* Just to remove compiler warning. */	( void ) pvParameters;	for( ;; )	{		/* Attempt to obtain the mutex.  We should block until the 		controlling task has given up the mutex, and not actually execute		past this call until the controlling task is suspended. */		if( xSemaphoreTakeRecursive( xMutex, portMAX_DELAY ) == pdPASS )		{			if( xControllingIsSuspended != pdTRUE )			{				/* Did not expect to execute until the controlling task was				suspended. */				xErrorOccurred = pdTRUE;			}			else			{				/* Give the mutex back before suspending ourselves to allow				the polling task to obtain the mutex. */				if( xSemaphoreGiveRecursive( xMutex ) != pdPASS )				{					xErrorOccurred = pdTRUE;				}				xBlockingIsSuspended = pdTRUE;				vTaskSuspend( NULL );				xBlockingIsSuspended = pdFALSE;			}		}		else		{			/* We should not leave the xSemaphoreTakeRecursive() function			until the mutex was obtained. */			xErrorOccurred = pdTRUE;		}		/* The controlling and blocking tasks should be in lock step. */		if( uxControllingCycles != ( uxBlockingCycles + 1 ) )		{			xErrorOccurred = pdTRUE;		}		/* Keep count of the number of cycles this task has performed so a 		stall can be detected. */		uxBlockingCycles++;	}}
开发者ID:Lzyuan,项目名称:STE-LPC1768-,代码行数:50,


示例2: vLimitedIncrementTask

/* * Just loops around incrementing the shared variable until the limit has been * reached.  Once the limit has been reached it suspends itself. */static void vLimitedIncrementTask( void * pvParameters ){    unsigned long *pulCounter;    /* Take a pointer to the shared variable from the parameters passed into    the task. */    pulCounter = ( unsigned long * ) pvParameters;    /* This will run before the control task, so the first thing it does is    suspend - the control task will resume it when ready. */    vTaskSuspend( NULL );    for( ;; )    {        /* Just count up to a value then suspend. */        ( *pulCounter )++;        if( *pulCounter >= priMAX_COUNT )        {            vTaskSuspend( NULL );        }    }}
开发者ID:apassi99,项目名称:ECE-4534,代码行数:27,


示例3: setup_Task

void setup_Task(void *pvParameters){	setup();	xTaskCreate(main_Task, (signed portCHAR *) "main", mainLoopStackSize, NULL, mainLoopPriority, &xHandleLoop);#if INCLUDE_vTaskDelete	vTaskDelete(xHandleSetup);#else	while(true) vTaskSuspend(NULL);#endif}
开发者ID:samboneym,项目名称:DuinOS,代码行数:14,


示例4: spiTask

void spiTask(void *data) {	TickType_t lastWakeUpTime = xTaskGetTickCount();	struct spi_slave **slave = data;	for (;;) {		printf("/n/n -- %lu -- /n/n", lastWakeUpTime);		{			uint16_t sendData[] = {(0x75 | BIT(7)), 0xFF};			uint16_t recvData[] = {0x4243, 0x4445};			int32_t ret;			printf("MCU Test/n");			ret = spiSlave_transver(slave[0], sendData, recvData, sizeof(sendData) / sizeof(uint16_t), 1000 / portTICK_PERIOD_MS);			CONFIG_ASSERT(ret == 0);			printf("recv: 0x%x 0x%x/n", recvData[0], recvData[1]);			ret = spiSlave_transver(slave[0], sendData, recvData, sizeof(sendData) / sizeof(uint16_t), 1000 / portTICK_PERIOD_MS);			CONFIG_ASSERT(ret == 0);			printf("recv: 0x%x 0x%x/n", recvData[0], recvData[1]);		}		/*vTaskDelayUntil(&lastWakeUpTime, 100 / portTICK_PERIOD_MS);*/		printf("/n/n -- %lu -- /n/n", lastWakeUpTime);		{			uint16_t sendData[] = {(0xf | BIT(7)), 0xFF};			uint16_t recvData[] = {0x4243, 0x4445};			int32_t ret;			printf("LSM330DLC Test/n");			ret = spiSlave_transver(slave[1], sendData, recvData, sizeof(sendData) / sizeof(uint16_t), 1000 / portTICK_PERIOD_MS);			CONFIG_ASSERT(ret == 0);			printf("recv: 0x%x 0x%x/n", recvData[0], recvData[1]);			ret = spiSlave_transver(slave[1], sendData, recvData, sizeof(sendData) / sizeof(uint16_t), 1000 / portTICK_PERIOD_MS);			CONFIG_ASSERT(ret == 0);			printf("recv: 0x%x 0x%x/n", recvData[0], recvData[1]);		}		printf("/n/n -- %lu -- /n/n", lastWakeUpTime);		{			uint16_t sendData[] = {(0xf | BIT(7)), 0xFF};			uint16_t recvData[] = {0x4243, 0x4445};			int32_t ret;			printf("LSM330DLC 2 Test/n");			ret = spiSlave_transver(slave[2], sendData, recvData, sizeof(sendData) / sizeof(uint16_t), 1000 / portTICK_PERIOD_MS);			CONFIG_ASSERT(ret == 0);			printf("recv: 0x%x 0x%x/n", recvData[0], recvData[1]);			ret = spiSlave_transver(slave[1], sendData, recvData, sizeof(sendData) / sizeof(uint16_t), 1000 / portTICK_PERIOD_MS);			CONFIG_ASSERT(ret == 0);			printf("recv: 0x%x 0x%x/n", recvData[0], recvData[1]);		}		vTaskDelayUntil(&lastWakeUpTime, 1000 / portTICK_PERIOD_MS);	}	vTaskSuspend(NULL);}
开发者ID:FreeRTOSHAL,项目名称:testsystem,代码行数:48,


示例5: prvMediumPriorityMutexTask

static void prvMediumPriorityMutexTask( void *pvParameters ){	( void ) pvParameters;	for( ;; )	{		/* The medium priority task starts by suspending itself.  The low		priority task will unsuspend this task when required. */		vTaskSuspend( NULL );		/* When this task unsuspends all it does is increment the guarded		variable, this is so the low priority task knows that it has		executed. */		ulGuardedVariable++;	}}
开发者ID:jefchavesfer,项目名称:H3DGE,代码行数:16,


示例6: prv_v_manage_user_action

// TODO: the function header.static void prv_v_manage_user_action( void ){unsigned portBASE_TYPE   uxNbMsgsInQueue = 0;   // Check if it is time to empty the xSUPERVISORQueue.   uxNbMsgsInQueue = uxQueueMessagesWaiting( xSUPERVISORQueue );   if( 0 != uxNbMsgsInQueue )   {      // Resume the User Action task.      vTaskSuspend( xSupervisorUserActionHndl );      vTaskResume( xSupervisorUserActionHndl );      // WARNING: What would happen if we try to resume a task that is not suspended?      // Is the FreeRTOS Kernel implementation safe on this one? To be sure, we issue      // a suspend before a resume.   }}
开发者ID:InSoonPark,项目名称:asf,代码行数:17,


示例7: prvChangePriorityHelperTask

static void prvChangePriorityHelperTask( void *pvParameters ){	/* Just to stop warning messages. */	( void ) pvParameters;	for( ;; )	{		/* This is the helper task for prvChangePriorityWhenSuspendedTask().		It has it's priority raised and lowered.  When it runs it simply 		increments the counter then suspends itself again.  This allows		prvChangePriorityWhenSuspendedTask() to know how many times it has		executed. */		ulPrioritySetCounter++;		vTaskSuspend( NULL );	}}
开发者ID:Cuixiaoxia198106,项目名称:freertos-sparc,代码行数:16,


示例8: about_task

/** * /brief About task * * This task prints a short text about the demo, with a simple zooming * animation. * * /param params Parameters for the task. (Not used.) */static void about_task(void *params){    char c;    gfx_coord_t x, y;    uint8_t i, shift;    char * text_to_use = (char *)&about_text;    const uint8_t max_shift = 8;    shift = 1;    for (;;) {        oled1_set_led_state(&oled1, OLED1_LED2_ID, true);        xSemaphoreTake(display_mutex, portMAX_DELAY);        // Print the about text in an expanding area        for (i = 0; i < (sizeof(about_text) - 1); i++) {            c = text_to_use[i];            x = (((i % TERMINAL_COLUMNS) * SYSFONT_WIDTH) * shift                 + (CANVAS_WIDTH / 2) * (max_shift - shift))                / max_shift;            y = (((i / TERMINAL_COLUMNS) * SYSFONT_HEIGHT) * shift                 + (CANVAS_HEIGHT / 2) * (max_shift - shift))                / max_shift;            gfx_mono_draw_char(c, x, y, &sysfont);        }        xSemaphoreGive(display_mutex);        oled1_set_led_state(&oled1, OLED1_LED2_ID, false);        // Repeat task until we're displaying the text in full size        if (shift < max_shift) {            shift++;            vTaskDelay(ABOUT_TASK_DELAY);        } else {            shift = 0;            vTaskSuspend(NULL);            if (tickless_enable) {                text_to_use = (char *)&about_text;            } else {                text_to_use = (char *)&about_text_tickless;            }            tickless_enable = !tickless_enable;        }    }}
开发者ID:ThucVD2704,项目名称:femto-usb-blink-example,代码行数:55,


示例9: recue_tim_func

void recue_tim_func(TimerHandle_t timer){	configASSERT(timer);	if(jar_status != FULL)	{		TIM_Cmd(TIM17, DISABLE);		TIM_CtrlPWMOutputs(TIM17, DISABLE);		GPIO_ResetBits(GPIOA, (GPIO_Pin_9));		GPIO_SetBits(GPIOA, GPIO_Pin_10);		xTimerStop(recue_tim_handler, 0);		vTaskSuspend(blink_handler);		jar_status = FULL;	}}
开发者ID:romanjoe,项目名称:CoffeeAuto,代码行数:17,


示例10: RECORDER_Startup

static void RECORDER_Startup (void){  vTaskSuspend(Core_Time_Task_Handle);  Recorder_UsedStorage = 0xFF;  if (AudioPlayerSettings.BackgroundEnabled == 0)  {    /* Switch to the recorder page */    RECORDER_SwitchPage(GL_HomePage, RECORDER_MAIN_PAGE);  }  else  {    /* Switch to the error page */    RECORDER_SwitchPage(GL_HomePage, RECORDER_ERROR_PAGE);  }}
开发者ID:denisweir,项目名称:STM32F40X,代码行数:17,


示例11: vStartQueueSetTasks

void vStartQueueSetTasks( void ){xTaskHandle xQueueSetSendingTask;	/* Create the two queues.  The handle of the sending task is passed into	the receiving task using the task parameter.  The receiving task uses the	handle to resume the sending task after it has created the queues. */	xTaskCreate( prvQueueSetSendingTask, ( signed char * ) "SetTx", configMINIMAL_STACK_SIZE, NULL, queuesetMEDIUM_PRIORITY, &xQueueSetSendingTask );	xTaskCreate( prvQueueSetReceivingTask, ( signed char * ) "SetRx", configMINIMAL_STACK_SIZE, ( void * ) xQueueSetSendingTask, queuesetMEDIUM_PRIORITY, NULL );	/* It is important that the sending task does not attempt to write to a	queue before the queue has been created.  It is therefore placed into the	suspended state before the scheduler has started.  It is resumed by the	receiving task after the receiving task has created the queues and added the	queues to the queue set. */	vTaskSuspend( xQueueSetSendingTask );}
开发者ID:InSoonPark,项目名称:FreeRTOS,代码行数:17,


示例12: ETHERNET_Startup

/**  * @brief  Handle the Module startup action and display the main menu  * @param  None  * @retval None  */static void ETHERNET_Startup (void){  vTaskSuspend(Core_Time_Task_Handle);    if(EthernetSettings.BackgroundEnabled)  {    ETHERNET_SwitchPage(GL_HomePage, ETHERNET_WARNING_PAGE);  }  else  {    EthernetSettings.BackgroundEnabled = 0;    EthernetSettings.DistantControlEnabled = 0;    EthernetSettings.WebserverEnabled = 0;    EthernetSettings.InitDone = 0;    ETHERNET_SwitchPage(GL_HomePage, ETHERNET_MAIN_PAGE);  }}
开发者ID:denisweir,项目名称:STM32F40X,代码行数:22,


示例13: vButtonTask

void vButtonTask(void* pvParameters){	xSemaphoreTake(xButtonSemaphore,buttonNO_BLOCK);	for(;;){		xSemaphoreTake(xButtonSemaphore, portMAX_DELAY);		ulButtonPressCount++;		xSemaphoreGive(xStatusSemaphore);		if(eTaskGetState(xLedTaskHandle)== eBlocked || eTaskGetState(xLedTaskHandle)== eRunning ){			vTaskSuspend(xLedTaskHandle);		}		else if(eTaskGetState(xLedTaskHandle)==eSuspended){			vTaskResume(xLedTaskHandle);		}		vTaskDelay(500);	}}
开发者ID:jakubszlendak,项目名称:modbus_sensor,代码行数:17,


示例14: key_scan

void key_scan(void *pvParameters){		//unsigned int delay = 1000;    asm("FIQ ON");    // To initialize the input pins for key.	    while(1)    {	    //vTaskDelay( delay / portTICK_RATE_MS );	            // To scan key if audio playing or just weak-up by key changed        // else 	    vTaskSuspend( NULL );    }}
开发者ID:Alicia29,项目名称:TOY,代码行数:18,


示例15: return_from_webserver

/**  * @brief  Return the module main menu from Webserver page  * @param  None  * @retval None  */static void return_from_webserver(void){  EthernetSettings.WebserverEnabled = 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;  }  if (Ethernet_xSemaphore != 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;  }  DMA_Cmd(DMA2_Stream1, DISABLE);  DCMI_Cmd(DISABLE);  DCMI_CaptureCmd(DISABLE);  netif_remove(&xnetif);  ETHERNET_SwitchPage(EthernetWebServerPage, ETHERNET_MAIN_PAGE);  EthernetWebServerPage = NULL;}
开发者ID:denisweir,项目名称:STM32F40X,代码行数:49,


示例16: gui_pedometer_Task

/** * [gui_pedometer_Task description] * @param  task_param_t [description] * @return              [description] */static void gui_pedometer_Task( task_param_t param ){	while (1)	{		gui_status_t			rightClickStatus = GuiDriver_QueueMsgGet( &gui_pedometer_packet , OSA_WAIT_FOREVER );		if( GUI_STATUS_SUCCESS == rightClickStatus )		{			if ( packetType_pressRight == gui_pedometer_packet.type )			{				if ( false == isPedometerActive )				{					isPedometerActive = true;					power_DisablePowerSave();					GuiDriver_CleanMainArea();				    GuiDriver_LabelDraw( &gui_pedometer_stepCounter_label );				    GuiDriver_LabelDraw( &gui_pedometer_stepText_label );				    GuiDriver_LabelDraw( &gui_pedometer_calCounter_label );				    GuiDriver_LabelDraw( &gui_pedometer_calText_label );				    GuiDriver_ImageDraw(&screen_buttonStop);					vTaskResume( gui_pedometer_step_counter_taskHandler );					pedometer_Resume();				}				else				{  					pedometer_Pause();  					vTaskSuspend( gui_pedometer_step_counter_taskHandler );  					GuiDriver_CleanMainArea();  					GuiDriver_ImageDraw( &gui_pedometer_icon );  					GuiDriver_ImageDraw(&screen_buttonStart);  					power_EnablePowerSave();  					isPedometerActive = false;				}				haptic_Vibrate();			}		}	}}
开发者ID:Btar,项目名称:HEXIWEAR,代码行数:49,


示例17: task_start

void task_start(void *pvParameters){	(void) pvParameters;		/* Start the LED flash tasks */	xTaskCreate(task_led, (signed char*)"LED", TASK_LED_STACK_SIZE, NULL, 				TASK_LED_PRIORITY, ( xTaskHandle * ) NULL);		/* Start the ethernet tasks. */	vStartEthernetTaskLauncher( TASK_START_ETH_PRIORITY );		/* Start the SPI app tasks. */	vStartSpiTaskLauncher( TASK_SPI_HANDLE_PRIORITY );		for (;;)	{		vTaskSuspend(vStartTaskHandler);							/* Suspend START task. */	}}
开发者ID:navinars,项目名称:etz-main,代码行数:19,


示例18: IR3

void IR3(void *p){while(1){ UpdateLeftPWM(400);	//Velocity Setting UpdateRightPWM(400);	//Velocity Setting if(sen_dat[1]<210) //IR 3   {     Stop();	 vTaskSuspend(xforward);	 if( sen_dat[2]>170)	 {      //DelaymSec(200);     Right();   	DelaymSec(50);	Stop();	DelaymSec(50);	 }	 else if (sen_dat[0]>190)	 {	  Left();	  DelaymSec(50);	 }	 else if(sen_dat[2]>170)	 {	   Right();	   DelaymSec(50);	 }	 else	 {	  Back();	  DelaymSec(50);	 }    	 if(sen_dat[1]>200)	 {	   vTaskResume(xforward);	 } }}}
开发者ID:Avilashm,项目名称:RTOS_LPC2148,代码行数:42,


示例19: stop_filling

void stop_filling(void * pvParameters ){	for(;;)	{		if (xSemaphoreTake(full_sem, portMAX_DELAY) == pdPASS)		{			if (GPIO_ReadInputDataBit(GPIOA, GPIO_Pin_1) == SET)			{				jar_status = FULL;				TIM_Cmd(TIM17, DISABLE);				TIM_CtrlPWMOutputs(TIM17, DISABLE);				TIM17->CCR1 = MOTOR_PWM_PERIOD;				vTaskSuspend(blink_handler);				GPIO_ResetBits(GPIOA, (GPIO_Pin_9 | GPIO_Pin_10));				xTimerStop(recue_tim_handler, 0);			}		}	}	vTaskDelete(NULL);}
开发者ID:romanjoe,项目名称:CoffeeAuto,代码行数:20,


示例20: vTask4

void vTask4(void *pvParameters) {	// Remove compiler warnings.	(void) pvParameters;		xTimer1 = xTimerCreate( "Timer 1",( 4000 ), pdTRUE,( void * ) 41, vTimerCallback1);	xTimerStart(xTimer1,0);		vTaskDelay(2000);	xTimer2 = xTimerCreate( "Timer 2",( 4000 ), pdTRUE,( void * ) 42, vTimerCallback2);	xTimerStart(xTimer2,0);		vTaskDelay(1000);	xTimer3 = xTimerCreate( "Timer 3",( 2000 ), pdTRUE,( void * ) 43, vTimerCallback3);	xTimerStart(xTimer3,0);		while (1) {		vTaskSuspend(NULL);	}	vTaskDelete(NULL);}
开发者ID:jimmi280586,项目名称:asembler,代码行数:20,


示例21: prvTaskToDelete

static void prvTaskToDelete( void *pvParameters ){	/* Remove compiler warnings about unused parameters. */	( void ) pvParameters;	/* Check the enter and exit critical macros are working correctly.  If the	SVC priority is below configMAX_SYSCALL_INTERRUPT_PRIORITY then this will	fault. */	taskENTER_CRITICAL();	taskEXIT_CRITICAL();	/* Exercise the API of various RTOS objects. */	prvExerciseEventGroupAPI();	prvExerciseSemaphoreAPI();	prvExerciseTaskNotificationAPI();	/* For code coverage test purposes it is deleted by the Idle task. */	configASSERT( uxTaskGetStackHighWaterMark( NULL ) > 0 );	vTaskSuspend( NULL );}
开发者ID:sean93park,项目名称:freertos,代码行数:20,


示例22: wdt_task

void wdt_task( void *pvParameters ){	portTickType xLastWakeTime;	wdt_opt_t wdt_options;	struct tWatchdogRequest request;	unsigned char gpsShutdown = FALSE, usbShutdown = FALSE, dataflashShutdown = FALSE, fuelShutdown = FALSE;		debug_log(DEBUG_PRIORITY_INFO, DEBUG_SENDER_WDT, "Task Started");		wdtManagerQueue = xQueueCreate(WATCHDOG_QUEUE_SIZE, sizeof(request));		if( wdt_triggered() ){		debug_log(DEBUG_PRIORITY_WARNING, DEBUG_SENDER_WDT, "Reset from watchdog");	}		xLastWakeTime = xTaskGetTickCount();		wdt_options.us_timeout_period = WATCHDOG_TIMEOUT_US;	wdt_enable(&wdt_options);		while(1){		wdt_clear();				if( xQueueReceive(wdtManagerQueue, &request, pdFALSE) == pdTRUE ){			switch(request.command){				case(WDT_REQUEST_POWEROFF):					debug_log(DEBUG_PRIORITY_INFO, DEBUG_SENDER_WDT, "Shutdown requested");					fuel_send_request(FUEL_MGR_REQUEST_SHUTDOWN, NULL, NULL, NULL, NULL);					//flash_send_request(FLASH_REQUEST_SHUTDOWN, NULL, NULL, NULL, NULL, NULL);					flash_send_request(FLASH_MGR_REQUEST_SHUTDOWN, NULL, NULL, NULL, NULL, NULL);					gps_send_request(GPS_MGR_REQUEST_SHUTDOWN, NULL, NULL, NULL, pdFALSE);										debug_log(DEBUG_PRIORITY_INFO, DEBUG_SENDER_WDT, "Going down!");					wdt_clear();	// Kick the watchdog one more time to allow debug messages to be sent					vTaskSuspend(NULL);					break;			}		}				vTaskDelayUntil( &xLastWakeTime, ( WATCHDOG_UPDATE_INTERVAL_MS / portTICK_RATE_MS ) );	}}
开发者ID:ryandavid,项目名称:traqpaq,代码行数:41,


示例23: vyber

void vyber( void * pvParameters ){	(void) pvParameters; /* parameter not used */	for ( ;; ) {		LCD_clear();		LCD_puts("VYBER: 500");		BankaOperace(-500);		nVyberu++;		// Po 5-ti probìhnutích se ukonèíme		if (nVyberu >= 5) {			VkladBezi = 0;			vTaskSuspend(TaskVyber);		}		// Akce se provadi kazdych 900 ms		vTaskDelay(900 / portTICK_RATE_MS);	}}
开发者ID:jdolinay,项目名称:utb_frdm_vyuka,代码行数:21,


示例24: transmitTask

void ICACHE_FLASH_ATTRtransmitTask(void *pvParameters){    struct userdata *user = (struct userdata *)pvParameters;    float temperature;    int a, b;    while(1) {        // Suspend ourselves.        vTaskSuspend( NULL );        // Mutex & Semaphore ?        xQueueReceive(user->xQueue, &temperature, portMAX_DELAY);        a = (int)temperature / 100;        b = (int)temperature % 100;        printf("{ /"temperature/": %d.%d }/n", a, b);    }}
开发者ID:chinlin0924,项目名称:rtos-wot,代码行数:21,


示例25: task_suspend

// suspends the given task if it was not already suspended, and (always) checks it out of the watchdogvoid task_suspend(task_type_t task_id) {	TaskHandle_t* task_handle = task_handles[task_id];	configASSERT(task_handle != NULL && *task_handle != NULL); // the latter would suspend THIS task	configASSERT(task_id != BATTERY_CHARGING_TASK				&& task_id != STATE_HANDLING_TASK 				&& task_id != WATCHDOG_TASK 				&& task_id != PERSISTENT_DATA_BACKUP_TASK);	// always check out of watchdog when called (to be double-sure)	// this is only called here so doesn't need to be safe	check_out_task_unsafe(task_id);	if (task_handle != NULL && *task_handle != NULL		&& eTaskGetState(*task_handle) != eSuspended) 	{		// actually suspend using handle		vTaskSuspend(*task_handle);	}	// if task_handle or it's value was NULL, we're in for a watchdog reset	// which is what we want because somethings very wrong}
开发者ID:BrownCubeSat,项目名称:EQUiSat,代码行数:22,


示例26: vtaskControlTask

void vtaskControlTask(void* pvParameters){	PORTF = 0x80;	for (;;)	{		if (xSemaphoreTake(xKeyInSemaphore, portMAX_DELAY) == pdTRUE)		{			vTaskDelay(SW_DEBOUNCE_TIME);			if ((PIND & 0x01) == 0x00) {				vTaskSuspend(xHandleLED1);				PORTF = 0x40;			}			if ((PIND & 0x02) == 0x00) {				vTaskResume(xHandleLED1);				PORTF = 0x80;			}			EIMSK |= 0x03;		}	}}
开发者ID:hokim72,项目名称:FreeRTOS,代码行数:21,


示例27: IR3_IR4

void IR3_IR4 (void *p){ while(1){UpdateLeftPWM(400);	//Velocity SettingUpdateRightPWM(400);	//Velocity Settingif(( ADC_Data[2]>60) && (sen_dat[1]<230)) //IR 3 and IR 4   {     Stop();	 vTaskSuspend(xforward);	 Back();     DelaymSec(50);     Soft_Left2();     DelaymSec(50);	 if(( ADC_Data[2]<180)&&(sen_dat[1]>180))	 {	   vTaskResume(xforward);	 }    }  }}
开发者ID:Avilashm,项目名称:RTOS_LPC2148,代码行数:21,


示例28: vInterruptMutexSlaveTask

static void vInterruptMutexSlaveTask( void *pvParameters ){    /* Just to avoid compiler warnings. */    ( void ) pvParameters;    for( ;; ) {        /* This task starts by suspending itself so when it executes can be        controlled by the master task. */        vTaskSuspend( NULL );        /* This task will execute when the master task already holds the mutex.        Attempting to take the mutex will place this task in the Blocked        state. */        if( xSemaphoreTake( xMasterSlaveMutex, portMAX_DELAY ) != pdPASS ) {            xErrorDetected = pdTRUE;        }        if( xSemaphoreGive( xMasterSlaveMutex ) != pdPASS ) {            xErrorDetected = pdTRUE;        }    }}
开发者ID:peterliu2,项目名称:tivaWare,代码行数:22,



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


C++ vTaskSuspendAll函数代码示例
C++ vTaskStartScheduler函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。