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

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

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

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

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

示例1: vInterruptCountingSemaphoreTask

static void vInterruptCountingSemaphoreTask( void *pvParameters ){    BaseType_t xCount;    const TickType_t xDelay = pdMS_TO_TICKS( intsemINTERRUPT_MUTEX_GIVE_PERIOD_MS ) * ( intsemMAX_COUNT + 1 );    ( void ) pvParameters;    for( ;; ) {        /* Expect to start with the counting semaphore empty. */        if( uxQueueMessagesWaiting( ( QueueHandle_t ) xISRCountingSemaphore ) != 0 ) {            xErrorDetected = pdTRUE;        }        /* Wait until it is expected that the interrupt will have filled the        counting semaphore. */        xOkToGiveCountingSemaphore = pdTRUE;        vTaskDelay( xDelay );        xOkToGiveCountingSemaphore = pdFALSE;        /* Now it is expected that the counting semaphore is full. */        if( uxQueueMessagesWaiting( ( QueueHandle_t ) xISRCountingSemaphore ) != intsemMAX_COUNT ) {            xErrorDetected = pdTRUE;        }        if( uxQueueSpacesAvailable( ( QueueHandle_t ) xISRCountingSemaphore ) != 0 ) {            xErrorDetected = pdTRUE;        }        ulCountingSemaphoreLoops++;        /* Expect to be able to take the counting semaphore intsemMAX_COUNT        times.  A block time of 0 is used as the semaphore should already be        there. */        xCount = 0;        while( xSemaphoreTake( xISRCountingSemaphore, 0 ) == pdPASS ) {            xCount++;        }        if( xCount != intsemMAX_COUNT ) {            xErrorDetected = pdTRUE;        }        /* Now raise the priority of this task so it runs immediately that the        semaphore is given from the interrupt. */        vTaskPrioritySet( NULL, configMAX_PRIORITIES - 1 );        /* Block to wait for the semaphore to be given from the interrupt. */        xOkToGiveCountingSemaphore = pdTRUE;        xSemaphoreTake( xISRCountingSemaphore, portMAX_DELAY );        xSemaphoreTake( xISRCountingSemaphore, portMAX_DELAY );        xOkToGiveCountingSemaphore = pdFALSE;        /* Reset the priority so as not to disturbe other tests too much. */        vTaskPrioritySet( NULL, tskIDLE_PRIORITY );        ulCountingSemaphoreLoops++;    }}
开发者ID:peterliu2,项目名称:tivaWare,代码行数:58,


示例2: sendDataTask

/* * sendDataTask read data from xQueueOutput and send them * to the mobile application through the Bluetooth module * (UART interface for now is used) */void sendDataTask(void *pvParameters) {	uint8_t flag = FANION;	uint8_t buff[MAX_XQUEUEOUTPUT];	memset(buff, 0, sizeof(buff));#ifdef DEBUG_MODE	UART_Send(LPC_UART0, "sendDataTask launched/r/n", strlen("sendDataTask launched/r/n"), NONE_BLOCKING);#endif	for(;;) {		if(xQueueOutput != 0) { // xQueueOutput MUST be valid			vTaskDelay((PERIOD/portTICK_PERIOD_MS));			if(uxQueueMessagesWaiting(xQueueOutput) > 0) {				xQueueReceive(xQueueOutput, buff, (TickType_t) 0);				UART_Send(LPC_UART0, &flag, 1, NONE_BLOCKING);				UART_Send(LPC_UART0, buff, sizeof(buff), NONE_BLOCKING);			}		}else {			UART_Send(LPC_UART0, &flag, 1, NONE_BLOCKING);			UART_Send(LPC_UART0, "Error - xQueueOutput not valid", strlen("Error - xQueueOutput not valid"), NONE_BLOCKING);		}	}}
开发者ID:jeremydu,项目名称:plugandsee,代码行数:30,


示例3: sys_mbox_free

/** * Destroys a mailbox. * * @param mbox is the mailbox to be destroyed. */voidsys_mbox_free(sys_mbox_t *mbox){  /* There should not be any messages waiting (if there are it is a bug).  If     any are waiting, increment the mailbox error count. */#if RTOS_FREERTOS  if(uxQueueMessagesWaiting(mbox->queue) != 0) {#endif /* RTOS_FREERTOS */#if SYS_STATS    STATS_INC(sys.mbox.err);#endif /* SYS_STATS */  }	/* Find a semaphore that would be freed. */	u32_t i;	for(i = 0; i < SYS_MBOX_MAX; i++) {		if(mboxes[i].queue == mbox->queue) {			mboxes[i].queue = SYS_MBOX_NULL;			vSemaphoreDelete(mbox->queue);			mbox->queue = 0;			return;		}	}  /* Clear the queue handle. */  mbox->queue = 0;  /* Update the mailbox statistics. */#if SYS_STATS   STATS_DEC(sys.mbox.used);#endif /* SYS_STATS */}
开发者ID:samutronics,项目名称:robohome,代码行数:38,


示例4: Serial2_GetChar

/**		Returns a single character from the receive queue if available.  This character is returned  unsigned - i.e. having a value of 0 - 255.  The return value is -1 if there is no character waiting.  @return character from the queue or -1 if there is no character.*/int Serial2_GetChar( int index ){  if ( index < 0 || index > 1 )    return CONTROLLER_ERROR_ILLEGAL_INDEX;  Serial2_* s2p = &Serial2[ index ];  if ( s2p->users == 0 )  {    int status = Serial2_SetActive( index, 1 );    if ( status != CONTROLLER_OK )      return -1;  }  if ( uxQueueMessagesWaiting( s2p->receiveQueue ) )  {    unsigned char c;    if( xQueueReceive( s2p->receiveQueue, &c, 0 ) == 0 )      return -1;    else      return (int)c;  }  else    return -1; }
开发者ID:YTakami,项目名称:makecontroller,代码行数:30,


示例5: Sensor_HasMessage

// *************** Sensor_HasMessage *************** int Sensor_HasMessage( PORT_T *port ){	if(uxQueueMessagesWaiting( (xQueueHandle)port->rx_fifo ) > 0) 		return SENSOR_TRUE;	else		return SENSOR_FALSE;}	
开发者ID:yguo89,项目名称:RTOS,代码行数:8,


示例6: prvLcdShow

void prvLcdShow( void *pvParameters ){    uint8_t symb, buffer_cnt=0, el_in_queue=0;    portBASE_TYPE xStatus;    while(1){    	el_in_queue = uxQueueMessagesWaiting(xQueueLCD);    	if(el_in_queue > 0){    		if(xSemaphoreTake(xLcdMutex, portMAX_DELAY) == pdPASS){            	while(el_in_queue > 0){            		if(xQueueReceive(xQueueLCD, &symb, 0) == pdPASS){            			if (buffer_cnt == 32){							lcd_clrscr();							buffer_cnt = 0;						}						if(buffer_cnt == 16){							lcd_goto(2,0);						}						lcd_putc(symb);						buffer_cnt++;						el_in_queue--;            		}            	}            	xSemaphoreGive(xLcdMutex);    		}    	}    }}
开发者ID:RomanGrekov,项目名称:I7_RTOS,代码行数:28,


示例7: vTaskFillFrame

/***************************************************函数名:vTaskFillFrame参数  :返回值:描述  :填写点击屏幕产生的数据帧***************************************************/void vTaskFillFrame( void* pvParam ){	TP_DATA buf ;	static MSG_A1_OUT temp ;	//static u8 A1[7] = { 0X5A, 0X08, 0XFF, 0XFF, 0XFF, 0XFF, 0XA1 } ; 	Uart_putstr( "vTaskFillFrame start " ) ;	while(1)	{				xQueueReceive( xqh_Tpdata, &buf, portMAX_DELAY ) ;  		//*		Buf_A1_OUT.client_ID = Get_clientID() ;		//屏幕点击产生数据填写		Buf_A1_OUT.feature_ID = buf.allorsg << 3 ;		Buf_A1_OUT.feature_ID |= buf.id << 4  ;		Buf_A1_OUT.btA |= buf.temperature << 4 ;        //A1同报btA的高四位为温度		Buf_A1_OUT.btA |= buf.runmode << 1 ;						//A1同报btA的D3~D1为模式		Buf_A1_OUT.btA |= buf.windupdown ;	            //A1同报btA的最低位为上下白凤		Buf_A1_OUT.btB |= buf.envtemperature << 2 ;	    //A1同报 btB 的7~2位为环境温度		Buf_A1_OUT.btC |= buf.windspeed << 4 ;		Buf_A1_OUT.btC |= buf.windleftright << 4 ;							//特殊设定填写		Buf_A1_OUT.btB |= Registing[buf.id].speset.eding ;		Buf_A1_OUT.btD |= Registing[buf.id].speset.adress_allow_set << 3 ;		Buf_A1_OUT.btD |= Registing[buf.id].speset.jingyadangshu << 1 ;		Buf_A1_OUT.checksum = CheckingSum( (u8*)&Buf_A1_OUT, 7 ) ;		//*/		while( uxQueueMessagesWaiting(xqh_Tpframe) )    			xQueueReceive( xqh_Tpframe, &temp, portMAX_DELAY ) ;   //覆盖原有邮件		memcpy( (void*)((u8*)&temp), (void*)((u8*)&Buf_A1_OUT), 7 ) ;  //传递拷贝份,避免在发送数据过程中,buf_a1_out被重写		xQueueSend( xqh_Tpframe, (void*)&temp, 0 ) ;	}}
开发者ID:ShaohuiZhu,项目名称:Haier-1,代码行数:42,


示例8: get_uart_commands

void get_uart_commands(void)/******************************************************************************   Function : Parses commands from UART.*****************************************************************************/{	portBASE_TYPE status;	uart_command c;		// Evenst from UART	if(uxQueueMessagesWaiting(uart_command_queue) != 0)	{		status = xQueueReceive(uart_command_queue, &c, 0);				if(status == pdPASS)		{			switch ( c.type )			{				case UART_COMMAND_POSITION:					switch ( c.key )					{						case UART_COMMAND_X_AXIS:						if(c.value >= 0 && c.value <= 1079)						{							write_5_char_int_to_buffer (11, 0, c.value ); // Disable on production							xSemaphoreTake(x_pos_mutex, portMAX_DELAY );							x_target_pos = c.value;							xSemaphoreGive(x_pos_mutex );						}						break;					}				break;			}		}	}}
开发者ID:nis,项目名称:RobTek-4th-semester-2011-project,代码行数:35,


示例9: RtlMailboxMsgWaiting

/****************************************************************************** * Function: RtlMailboxMsgWaiting * Desc: To get the number of message blocks are storing in a given mailbox. * Para: *  MboxID: The identifier of the target mailbox. *  IsFromISR: Is this function is called from an ISR ? * Return: The number of message blocks are storing in this mailbox. ******************************************************************************/u32 RtlMailboxMsgWaiting(    IN u8 MboxID,     IN u8 IsFromISR){	RTL_MAILBOX *pMbox=NULL;    u32 msg_num=0;	pMbox = RtlMBoxIdToHdl(MboxID);	if (NULL == pMbox) {		MSG_MBOX_ERR("RtlMailboxMsgWaiting: Didn't find the MBox with ID=%d/n", MboxID);		return 0;	}#ifdef PLATFORM_FREERTOS    if (IsFromISR) {        msg_num = uxQueueMessagesWaitingFromISR(pMbox->mbox_hdl);    }    else {        msg_num = uxQueueMessagesWaiting(pMbox->mbox_hdl);    }#endif#ifdef PLATFORM_ECOS    // TODO: call eCos API to implement this function#endif    return msg_num;}
开发者ID:silenceuncrio,项目名称:ameba_ws2812b,代码行数:39,


示例10: BufferCapacity

bool BufferCapacity(){	unsigned portBASE_TYPE uxBufLen = uxQueueMessagesWaiting(s_QueueBuff);	if (uxBufLen < 128)		return false;	return true;}
开发者ID:takeshineshiro,项目名称:cc3200_wifi_module,代码行数:7,


示例11: Serial_GetChar

/**		Returns a single character from the receive queue if available.  This character is returned unsigned - i.e. having a value of 0 - 255.    The return value is -1 if there is no character waiting.  @param index Which serial port - SERIAL_0 or SERIAL_1  @return character from the queue or -1 if there is no character.*/int Serial_GetChar( int index ){  if ( index < 0 || index >= SERIAL_PORTS )    return CONTROLLER_ERROR_ILLEGAL_INDEX;  Serial_* sp = &Serial[ index ];  if ( !sp->active )  {    int status = Serial_SetActive( index, 1 );    if ( status != CONTROLLER_OK )      return -1;  }  if ( uxQueueMessagesWaiting( sp->receiveQueue ) )  {    unsigned char c;    if( xQueueReceive( sp->receiveQueue, &c, 0 ) == 0 )      return -1;    else      return (int)c;  }  else    return -1; }
开发者ID:YTakami,项目名称:makecontroller,代码行数:32,


示例12: vReceiverTask

static void vReceiverTask(void* pvParameters){	// Declare the structure that will hold the values received from the queue.	xData xReceivedStructure;	portBASE_TYPE xStatus;	// This task is also defined within an infinite loop.	for (;;)	{		// Because it has the lowest priority this task will only run when the		// sending tasks are in the Blocked state. The sending tasks will only		// enter the Blocked state when the queue is full so this task always		// expects the number of items in the queue to be equal to the queue		// length - 3 in this case.		if ( uxQueueMessagesWaiting(xQueue) != 3)		{			vTaskSuspendAll();			xil_printf("Queue should have been full!/n");		}		// Receive from the queue.		// The second parameter is the buffer into which the received data will		// be placed. In this case the buffer is simply the address of a variable		// that has the required size to hold the received structure.				// The last parameter is the block time - the maximum amount of time 		// that the task will remain in the Blocked state to wait for data to		// be available if the queue is already empty. In this case a block time		// is not necessary because this task will only run when queue is full.		xStatus = xQueueReceive(xQueue, &xReceivedStructure, 0);		if (xStatus == pdPASS)		{			// Data was successfully received from the queue, print out the			// received value and the source of the value.			if (xReceivedStructure.ucSource == mainSENDER_1)			{				vTaskSuspendAll();				xil_printf("From Sender 1 = %d/n", xReceivedStructure.ucValue);				xTaskResumeAll();			}			else			{				vTaskSuspendAll();				xil_printf("From Sender 2 = %d/n", xReceivedStructure.ucValue);				xTaskResumeAll();			}		}		else		{			// Nothing was received from the queue. This must be an error			// as this task should only run when the queue is full.			vTaskSuspendAll();			xil_printf("Could not receive from the queue./n");			xTaskResumeAll();		}	}}
开发者ID:hokim72,项目名称:XIL_EDK,代码行数:59,


示例13: updateSpindleSpeed

static void updateSpindleSpeed(uint32_t speed){    while(uxQueueMessagesWaiting( movementQueue )); // Clear Movements        if(speed > 100)        speed = 100;    TIM_SetCompare1(TIM3, 2400 * speed / 100);    return;}
开发者ID:anarchih,项目名称:Enhanced-CNC-Controller,代码行数:8,


示例14: check_for_char

inline bool frt_text_queue::check_for_char (void){	if (uxQueueMessagesWaiting (the_queue) == 0)	{		return (false);	}	return (true);}
开发者ID:HamboLagos,项目名称:automated_wheel_truing_machine,代码行数:8,


示例15: sys_mbox_free

/** * Destroys a mailbox. * * @param mbox is the mailbox to be destroyed. */voidsys_mbox_free(sys_mbox_t mbox){  unsigned portBASE_TYPE count;  /* There should not be any messages waiting (if there are it is a bug).  If     any are waiting, increment the mailbox error count. */#if RTOS_SAFERTOS  if((xQueueMessagesWaiting(mbox->queue, &count) != pdPASS) || (count != 0)) {#elif RTOS_FREERTOS  if(uxQueueMessagesWaiting(mbox->queue) != 0) {#endif /* RTOS_SAFERTOS */#if SYS_STATS    STATS_INC(sys.mbox.err);#endif /* SYS_STATS */  }  /* Clear the queue handle. */  mbox->queue = 0;  /* Update the mailbox statistics. */#if SYS_STATS   STATS_DEC(sys.mbox.used);#endif /* SYS_STATS */}/** * The routine for a thread.  This handles some housekeeping around the * applications's thread routine. * * @param arg is the index into the thread structure for this thread */static voidsys_arch_thread(void *arg){  u32_t i;  /* Get this threads index. */  i = (u32_t)arg;  /* Call the application's thread routine. */  threads[i].thread(threads[i].arg);  /* Free the memory used by this thread's stack. */  mem_free(threads[i].stackstart);  /* Clear the stack from the thread structure. */  threads[i].stackstart = NULL;  threads[i].stackend = NULL;  /* Delete this task. */#if RTOS_SAFERTOS  xTaskDelete(NULL);#elif RTOS_FREERTOS  vTaskDelete(NULL);#endif}
开发者ID:hakkinen86,项目名称:Luminary-Micro-Library,代码行数:63,


示例16: Serial2_GetReadable

/**		Returns the number of bytes in the queue waiting to be read.  @return bytes in the receive queue.*/int Serial2_GetReadable( int index ){  if ( index < 0 || index > 1 )    return CONTROLLER_ERROR_ILLEGAL_INDEX;  Serial2_* s2p = &Serial2[ index ];  return uxQueueMessagesWaiting( s2p->receiveQueue );}
开发者ID:YTakami,项目名称:makecontroller,代码行数:13,


示例17: MPU_uxQueueMessagesWaiting

unsigned portBASE_TYPE MPU_uxQueueMessagesWaiting( const xQueueHandle pxQueue ){portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();unsigned portBASE_TYPE uxReturn;	uxReturn = uxQueueMessagesWaiting( pxQueue );	portRESET_PRIVILEGE( xRunningPrivileged );	return uxReturn;}
开发者ID:ADTL,项目名称:ARMWork,代码行数:9,


示例18: Serial_GetReadable

/**		Returns the number of bytes in the queue waiting to be read.  @param index Which serial port - SERIAL_0 or SERIAL_1  @return bytes in the receive queue.*/int Serial_GetReadable( int index ){  if ( index < 0 || index >= SERIAL_PORTS )    return CONTROLLER_ERROR_ILLEGAL_INDEX;  Serial_* sp = &Serial[ index ];  return uxQueueMessagesWaiting( sp->receiveQueue );}
开发者ID:YTakami,项目名称:makecontroller,代码行数:14,


示例19: MPU_uxQueueMessagesWaiting

UBaseType_t MPU_uxQueueMessagesWaiting( const QueueHandle_t pxQueue ){BaseType_t xRunningPrivileged = xPortRaisePrivilege();UBaseType_t uxReturn;	uxReturn = uxQueueMessagesWaiting( pxQueue );	vPortResetPrivilege( xRunningPrivileged );	return uxReturn;}
开发者ID:sean93park,项目名称:freertos,代码行数:9,


示例20: OSAL_SEM_GetCount

/* Function: uint8_t OSAL_SEM_GetCount(OSAL_SEM_HANDLE_TYPE semID)  Summary:    Return the current value of a counting semaphore.  Description:    Return the current value of a counting semaphore. The value returned is    assumed to be a single value ranging from 0-255.  Precondition:     Semaphore must have been created.  Parameters:     semID       - The semID  Returns:    0           - Semaphore is unavailable    1-255       - Current value of the counting semaphore  Example:    <code>     uint8_t semCount;     semCount = OSAL_SEM_GetCount(semUART);     if (semCount > 0)     {        // obtain the semaphore         if (OSAL_SEM_Pend(semUART) == OSAL_RESULT_TRUE)         {            // perform processing on the comm channel            ...         }     }     else     {        // no comm channels available        ...     }    </code>  Remarks:     This version of the OSAL_SEM_Post function should be used if the program     is, or may be, operating inside and ISR. The OSAL will take the necessary     steps to ensure correct operation possibly disabling interrupts or entering     a critical section. The exact requirements will depend upon the particular     RTOS being used. */uint8_t OSAL_SEM_GetCount(OSAL_SEM_HANDLE_TYPE* semID){   unsigned portBASE_TYPE SemCount;   SemCount = uxQueueMessagesWaiting(*(xSemaphoreHandle*)semID);   if(SemCount > 255)      SemCount = 255;   return SemCount;}
开发者ID:Eilliar,项目名称:wcm-aws-iot-sdk,代码行数:57,


示例21: MPU_uxQueueMessagesWaiting

UBaseType_t MPU_uxQueueMessagesWaiting( const QueueHandle_t pxQueue ){    BaseType_t xRunningPrivileged = prvRaisePrivilege();    UBaseType_t uxReturn;    uxReturn = uxQueueMessagesWaiting( pxQueue );    portRESET_PRIVILEGE( xRunningPrivileged );    return uxReturn;}
开发者ID:RitikaGupta1207,项目名称:freertos,代码行数:9,


示例22: sys_mbox_free

/*  Deallocates a mailbox. If there are messages still present in the  mailbox when the mailbox is deallocated, it is an indication of a  programming error in lwIP and the developer should be notified.*/voidsys_mbox_free(sys_mbox_t *mbox){    if (uxQueueMessagesWaiting(*mbox)) {        /* Line for breakpoint.  Should never break here! *///		__asm volatile ( "NOP" );    }    vQueueDelete(*mbox);}
开发者ID:FangDongbin,项目名称:esp8266-hilink,代码行数:15,


示例23: uartQueueIsEmpty

s08 uartQueueIsEmpty(u08 nUart){	switch(nUart) {	case 0:		if ( uxQueueMessagesWaiting(xUart0CharsForTxQueue) == 0)			return (TRUE);		else			return(FALSE);		break;	case 1:		if ( uxQueueMessagesWaiting(xUart1CharsForTxQueue) == 0)			return (TRUE);		else			return(FALSE);		break;	}}
开发者ID:spymovil,项目名称:sp5K,代码行数:20,


示例24: MOMENT_TASK

void MOMENT_TASK(void *pvParameters){	float Theta[3];	float Cordinate[3];	float F[3] = {0.0, 0.0, 20.0};	float Phi[3];	float Moment[3];	portBASE_TYPE xStatus;	CanRxMsg CanReceiveData;	Moment_Typedef M;	unsigned char Status;	while(1)	{		if (uxQueueMessagesWaiting(CanRxQueue) != NULL)		{			xStatus = xQueueReceive(CanRxQueue, &CanReceiveData, 1);			if (xStatus == pdPASS)			{				F[0] = CanReceiveData.Data[1];				F[1] = CanReceiveData.Data[3];				F[2] = CanReceiveData.Data[5];				if (CanReceiveData.Data[0] == 0)					F[0] = -F[0];				if (CanReceiveData.Data[2] == 0)					F[1] = -F[1];				if (CanReceiveData.Data[4] == 0)					F[2] = -F[2];				F[2] += 18.0;			}		}		Theta[0] = ((float)TSVN_QEI_TIM1_Value()*0.9)/7.0;		Theta[1] = ((float)TSVN_QEI_TIM4_Value()*0.9)/7.0;		Theta[2] = ((float)TSVN_QEI_TIM3_Value()*0.9)/7.0;				Status = (char)Delta_CalcForward(Theta[0], Theta[1], Theta[2], &Cordinate[0], &Cordinate[1], &Cordinate[2]);		if (Status == 0)		{			if (Cordinate[0] >= -44.165 && Cordinate[0] <= 44.165 && 					Cordinate[1] >= -44.165 && Cordinate[1] <= 44.165 &&					Cordinate[2] >= -203.648 && Cordinate[2] <= -115.318)			{					Phi[0] = -90.0;					Phi[1] = 30.0;					Phi[2] = 150;					MomentCalculate(Theta, Phi, Cordinate, F, &Moment);					M.Mx = Moment[0]*1100.0;					M.My = Moment[1]*1100.0;					M.Mz = Moment[2]*1100.0;					xQueueSendToBack(Moment_Queue, &M, 1);			}		}		TSVN_Led_Toggle(LED_D6);		vTaskDelay(200);	}}
开发者ID:NguyenTrongThinh,项目名称:FindPIDCoff,代码行数:54,


示例25: portTASK_FUNCTION

static portTASK_FUNCTION( vPolledQueueConsumer, pvParameters ){    unsigned portSHORT usData, usExpectedValue = ( unsigned portSHORT ) 0;    signed portBASE_TYPE xError = pdFALSE;#ifdef USE_STDIO    void vPrintDisplayMessage( const portCHAR * const * ppcMessageToSend );    const portCHAR * const pcTaskStartMsg = "Alt blocking queue consumer task started./r/n";    /* Queue a message for printing to say the task has started. */    vPrintDisplayMessage( &pcTaskStartMsg );#endif    for( ;; )    {        /* Loop until the queue is empty. */        while( uxQueueMessagesWaiting( *( ( xQueueHandle * ) pvParameters ) ) )        {            if( xQueueAltReceive( *( ( xQueueHandle * ) pvParameters ), &usData, pollqNO_DELAY ) == pdPASS )            {                if( usData != usExpectedValue )                {                    /* This is not what we expected to receive so an error has                    occurred. */                    xError = pdTRUE;                    /* Catch-up to the value we received so our next expected                    value should again be correct. */                    usExpectedValue = usData;                }                else                {                    if( xError == pdFALSE )                    {                        /* Only increment the check variable if no errors have                        occurred. */                        portENTER_CRITICAL();                        xPollingConsumerCount++;                        portEXIT_CRITICAL();                    }                }                /* Next time round we would expect the number to be one higher. */                usExpectedValue++;            }        }        /* Now the queue is empty we block, allowing the producer to place more        items in the queue. */        vTaskDelay( pollqCONSUMER_DELAY );    }} /*lint !e818 Function prototype must conform to API. */
开发者ID:ya-mouse,项目名称:freertos-np51x0,代码行数:53,


示例26: prvHighPriorityPeekTask

static void prvHighPriorityPeekTask( void *pvParameters ){xQueueHandle xQueue = ( xQueueHandle ) pvParameters;unsigned portLONG ulValue;	for( ;; )	{		/* Try peeking from the queue.  The queue should be empty so we will		block, allowing the medium priority task to execute.  Both the high		and highest priority tasks will then be blocked on the queue. */		if( xQueuePeek( xQueue, &ulValue, portMAX_DELAY ) != pdPASS )		{			/* We expected to have received something by the time we unblock. */			xErrorDetected = pdTRUE;		}		/* When we get here the highest priority task should have peeked the data		(unblocking this task) then suspended (allowing this task to also peek		the data). */		if( ulValue != 0x01234567 )		{			/* We did not receive the expected value. */			xErrorDetected = pdTRUE;		}		if( uxQueueMessagesWaiting( xQueue ) != 1 )		{			/* The message should have been left on the queue. */			xErrorDetected = pdTRUE;		}		/* We only peeked the data, so suspending ourselves now should enable		the medium priority task to also peek the data.  The medium priority task		will have been unblocked when we peeked the data as we left the data		in the queue. */		vTaskSuspend( NULL );		/* This time we are going actually receive the value, so the medium		priority task will never peek the data - we removed it from the queue. */		if( xQueueReceive( xQueue, &ulValue, portMAX_DELAY ) != pdPASS )		{			xErrorDetected = pdTRUE;		}		if( ulValue != 0xaabbaabb )		{			xErrorDetected = pdTRUE;		}		vTaskSuspend( NULL );					}}
开发者ID:darknesmonk,项目名称:freertos-5.1.2-lpc23xx,代码行数:53,


示例27: receiveFromMotorQ

// Read value from local message queuevoid receiveFromMotorQ() {    char readdata[MSG_LENGTH];    // Read from messages until most recent data (FIFO queue)    while (uxQueueMessagesWaiting(motorData.motorQ_LR) != 0){            if (xQueueReceive(motorData.motorQ_LR, &readdata, portMAX_DELAY))        {            //dbgOutputVal(MOTOR_RECEIVEFROMQ);        }     }}
开发者ID:bt2016,项目名称:ece4534_team4,代码行数:13,


示例28: sys_mbox_free

/*---------------------------------------------------------------------------* * Routine:  sys_mbox_free *---------------------------------------------------------------------------* * Description: *      Deallocates a mailbox. If there are messages still present in the *      mailbox when the mailbox is deallocated, it is an indication of a *      programming error in lwIP and the developer should be notified. * Inputs: *      sys_mbox_t mbox         -- Handle of mailbox * Outputs: *      sys_mbox_t              -- Handle to new mailbox *---------------------------------------------------------------------------*/void sys_mbox_free(sys_mbox_t *pxMailBox) {    #if SYS_STATS    unsigned long ulMessagesWaiting;        ulMessagesWaiting = uxQueueMessagesWaiting( *pxMailBox );    configASSERT( ( ulMessagesWaiting == 0 ) );    if (ulMessagesWaiting != 0UL) {            SYS_STATS_INC( mbox.err );    }        SYS_STATS_DEC( mbox.used );        #else        uxQueueMessagesWaiting( *pxMailBox);        #endif    vQueueDelete( *pxMailBox );}
开发者ID:obolon-svitle,项目名称:dcon-virtual-modules,代码行数:33,


示例29: setStepperState

static void setStepperState(uint32_t state){    while(uxQueueMessagesWaiting( movementQueue )); // Clear Movements    if(state){        GPIO_ResetBits(EnPinPort, XEnPin | YEnPin | ZEnPin);    }else{        GPIO_SetBits(EnPinPort, XEnPin | YEnPin | ZEnPin);    }        stepperState = state;    return;}
开发者ID:anarchih,项目名称:Enhanced-CNC-Controller,代码行数:12,


示例30: stack_buffer_get

/** *  Get buffer from stack. * *	/param blocktime  time to wait for buffer * *  /return           pointer to buffer, 0 on failure (all buffers allocated) */buffer_t* stack_buffer_get ( portTickType blocktime ){  buffer_t *b;  if (xQueueReceive( buffers, &( b ), 0) == pdTRUE)	{		b->dir = BUFFER_DOWN;		b->buf_ptr = 0;		b->buf_end = 0;		b->size = BUFFER_SIZE;		buffer_left--;		if (uxQueueMessagesWaiting(buffers) == 0){b->options.last_buffer_when_pulled = 1;}else{b->options.last_buffer_when_pulled = 0;}#ifdef CHECK_BUFFERS		del_from_buffer(b, avail_buffers);#endif /* CHECK_BUFFERS */		return b;	}    else if (xQueueReceive( buffers, &( b ), blocktime / portTICK_RATE_MS) == pdTRUE)	{		b->dir = BUFFER_DOWN;		b->buf_ptr = 0;		b->buf_end = 0;		b->size = BUFFER_SIZE;		buffer_left--;		if (uxQueueMessagesWaiting(buffers) == 0){b->options.last_buffer_when_pulled = 1;}else{b->options.last_buffer_when_pulled = 0;}#ifdef CHECK_BUFFERS		del_from_buffer(b, avail_buffers);#endif /* CHECK_BUFFERS */		return b;	}	debug_printf("S: No buffer left (%d)/r/n", mac_tx_wr);#ifdef HAVE_WDT	WDTCTL  = 0; // reset chip !#endif /* HAVE_WDG */	return 0;}
开发者ID:SmartGrains,项目名称:Murphy,代码行数:46,



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


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