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


C++ xQueueSendFromISR函数代码示例

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


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

示例1: prvSelectButtonInterrupt

interrupt void prvSelectButtonInterrupt( void )
{
/* Define the message sent to the LCD task from this interrupt. */
static const xQueueMessage xMessage = { mainMESSAGE_BUTTON_SEL, ( unsigned long ) "Select Interrupt" };
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;

	/* This is the interrupt handler for the joystick select button input.
	The button has been pushed, write a message to the LCD via the LCD task. */
	xQueueSendFromISR( xLCDQueue, &xMessage, &xHigherPriorityTaskWoken );

	P2IFG = 0;
	
	/* If writing to xLCDQueue caused a task to unblock, and the unblocked task
	has a priority equal to or above the task that this interrupt interrupted,
	then lHigherPriorityTaskWoken will have been set to pdTRUE internally within
	xQueuesendFromISR(), and portEND_SWITCHING_ISR() will ensure that this
	interrupt returns directly to the higher priority unblocked task. */
	portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
}
开发者ID:BirdBare,项目名称:STM32F4-Discovery_FW_V1.1.0_Makefiles,代码行数:19,代码来源:main.c

示例2: GPIO0_IRQHandler

void GPIO0_IRQHandler()
{

   portBASE_TYPE xSwitchRequired1;
   
   if (Chip_PININT_GetFallStates(LPC_GPIO_PIN_INT)&PININTCH0)
    { 
      Chip_PININT_ClearIntStatus(LPC_GPIO_PIN_INT,PININTCH0);   
      //xSemaphoreGiveFromISR(xSemaphore,&xSwitchRequired1);
      uint8_t aux=0;
      xQueueSendFromISR( xQueue1, ( void * ) &aux, &xSwitchRequired1);
      

      //NO USAR - xSemaphoreGive(xSemaphore);
    }
   portEND_SWITCHING_ISR(xSwitchRequired1);


}
开发者ID:mdarino,项目名称:LSE_SistOper1,代码行数:19,代码来源:main.c

示例3: EXTI9_5_IRQHandler

void EXTI9_5_IRQHandler( void )
{
/* Define the message sent to the LCD task from this interrupt. */
const xQueueMessage xMessage = { mainMESSAGE_BUTTON_SEL, ( unsigned long ) "Select Interrupt!" };
long lHigherPriorityTaskWoken = pdFALSE;

	/* This is the interrupt handler for the joystick select button input.
	The button has been pushed, write a message to the LCD via the LCD task. */
	xQueueSendFromISR( xLCDQueue, &xMessage, &lHigherPriorityTaskWoken );
	
	EXTI_ClearITPendingBit( SEL_BUTTON_EXTI_LINE );
	
	/* If writing to xLCDQueue caused a task to unblock, and the unblocked task
	has a priority equal to or above the task that this interrupt interrupted,
	then lHigherPriorityTaskWoken will have been set to pdTRUE internally within
	xQueuesendFromISR(), and portEND_SWITCHING_ISR() will ensure that this
	interrupt returns directly to the higher priority unblocked task. */
	portEND_SWITCHING_ISR( lHigherPriorityTaskWoken );
}
开发者ID:ammarkham,项目名称:freertos-moo,代码行数:19,代码来源:main.c

示例4: interrupt

/*
 * UART RX interrupt service routine.
 */
interrupt (UART1RX_VECTOR) wakeup vRxISR( void )
{
signed char cChar;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;

	/* Get the character from the UART and post it on the queue of Rxed 
	characters. */
	cChar = U1RXBUF;

	xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken );

	if( xHigherPriorityTaskWoken )
	{
		/*If the post causes a task to wake force a context switch 
		as the woken task may have a higher priority than the task we have 
		interrupted. */
		taskYIELD();
	}
}
开发者ID:InSoonPark,项目名称:FreeRTOS,代码行数:22,代码来源:serial.c

示例5: vSerialISR

/* Serial port ISR.  This can cause a context switch so is not defined as a
standard ISR using the __irq keyword.  Instead a wrapper function is defined
within serialISR.s79 which in turn calls this function.  See the port
documentation on the FreeRTOS.org website for more information. */
__arm void vSerialISR( void )
{
unsigned short usStatus;
signed char cChar;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;

	/* What caused the interrupt? */
	usStatus = UART_FlagStatus( UART0 );

	if( usStatus & UART_TxHalfEmpty )
	{
		/* The interrupt was caused by the THR becoming empty.  Are there any
		more characters to transmit? */
		if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == pdTRUE )
		{
			/* A character was retrieved from the queue so can be sent to the
			THR now. */
			UART0->TxBUFR = cChar;
		}
		else
		{
			/* Queue empty, nothing to send so turn off the Tx interrupt. */
			serINTERRUPT_OFF();
		}		
	}

	if( usStatus & 	UART_RxBufFull )
	{
		/* The interrupt was caused by a character being received.  Grab the
		character from the RHR and place it in the queue of received
		characters. */
		cChar = UART0->RxBUFR;
		xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken );
	}

	/* If a task was woken by either a character being received or a character
	being transmitted then we may need to switch to another task. */
	portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );

	/* End the interrupt in the EIC. */
	portCLEAR_EIC();
}
开发者ID:AskDrCatcher,项目名称:FreeRTOS,代码行数:46,代码来源:serial.c

示例6: vSerialISR

/* Serial port ISR.  This can cause a context switch so is not defined as a
standard ISR using the __irq keyword.  Instead a wrapper function is defined
within serialISR.s79 which in turn calls this function.  See the port
documentation on the FreeRTOS.org website for more information. */
__arm void vSerialISR( void )
{
unsigned long ulStatus;
signed char cChar;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;

	/* What caused the interrupt? */
	ulStatus = serCOM0->US_CSR &= serCOM0->US_IMR;

	if( ulStatus & AT91C_US_TXRDY )
	{
		/* The interrupt was caused by the THR becoming empty.  Are there any
		more characters to transmit? */
		if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == pdTRUE )
		{
			/* A character was retrieved from the queue so can be sent to the
			THR now. */
			serCOM0->US_THR = cChar;
		}
		else
		{
			/* Queue empty, nothing to send so turn off the Tx interrupt. */
			vInterruptOff();
		}		
	}

	if( ulStatus & AT91C_US_RXRDY )
	{
		/* The interrupt was caused by a character being received.  Grab the
		character from the RHR and place it in the queue or received
		characters. */
		cChar = serCOM0->US_RHR;
		xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken );
	}

	/* If a task was woken by either a character being received or a character
	being transmitted then we may need to switch to another task. */
	portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );

	/* End the interrupt in the AIC. */
	AT91C_BASE_AIC->AIC_EOICR = 0;
}
开发者ID:Pinekn,项目名称:freeRTOS,代码行数:46,代码来源:serial.c

示例7: prvUSCI_A1_ISR

static __interrupt void prvUSCI_A1_ISR( void )
{
signed char cChar;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;

	while( ( UCA1IFG & UCRXIFG ) != 0 )
	{
		/* Get the character from the UART and post it on the queue of Rxed
		characters. */
		cChar = UCA1RXBUF;
		xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken );
	}
	
	/* If there is a Tx interrupt pending and the tx interrupts are enabled. */
	if( ( UCA1IFG & UCTXIFG ) != 0 )
	{
		/* The previous character has been transmitted.  See if there are any
		further characters waiting transmission. */
		if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == pdTRUE )
		{
			/* There was another character queued - transmit it now. */
			UCA1TXBUF = cChar;
		}
		else
		{
			/* There were no other characters to transmit - disable the Tx
			interrupt. */
			UCA1IE &= ~UCTXIE;
		}
	}

	__bic_SR_register_on_exit( SCG1 + SCG0 + OSCOFF + CPUOFF );
	
	/* If writing to a queue caused a task to unblock, and the unblocked task
	has a priority equal to or above the task that this interrupt interrupted,
	then lHigherPriorityTaskWoken will have been set to pdTRUE internally within
	xQueuesendFromISR(), and portEND_SWITCHING_ISR() will ensure that this
	interrupt returns directly to the higher priority unblocked task.
	
	THIS MUST BE THE LAST THING DONE IN THE ISR. */	
	portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
}
开发者ID:DonjetaE,项目名称:FreeRTOS,代码行数:42,代码来源:serial.c

示例8: bus_rxISR

/**
 * Bus UART RX interrupt.
 */
void bus_rxISR( void )
{
	uint8_t byte;

	/* Get the character from the UART and post it on the queue of Rxed 
	characters. */
	byte = USART_ReceiveData(USART1);

	if( xQueueSendFromISR(debug_rx, &byte, pdFALSE ) )
	{
		/*If the post causes a task to wake force a context switch 
		as the woken task may have a higher priority than the task we have 
		interrupted. */
		taskYIELD();
	}
#ifdef HAVE_POWERSAVE
	power_interrupt_epilogue();
#endif

}
开发者ID:Paolo-Maffei,项目名称:nxstack,代码行数:23,代码来源:debug.c

示例9: EncolarEventoFromISR

portBASE_TYPE EncolarEventoFromISR (Modulo_t * receptor, Signal_t senial, int valor)
{
	//xQueueHandle colaEventos = getColaEventos(receptor->prioridad);
	portBASE_TYPE cambiarCtx = pdFALSE;
	/*Evento_t evn;
	evn.receptor = receptor;
	evn.signal = senial;
	evn.valor = valor;
*/

	EventoDriver_t msg;

	msg.codigo = 3; //timeoutSalud
	msg.dato = 0;

	xQueueSendFromISR(colaEventosDrivers, &msg, &cambiarCtx);

	//xQueueSendFromISR(colaEventos, &evn, &cambiarCtx);
	return cambiarCtx;
}
开发者ID:devtodev,项目名称:NXP,代码行数:20,代码来源:eventos.c

示例10: __gmsReceiveCSQData

static inline void __gmsReceiveCSQData(unsigned char data)
{
    if (data == 0x0A) {
        GsmTaskMessage *message;
        portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
        buffer[bufferIndex++] = 0;
        message = __gsmCreateMessage(TYPE_CSQ_DATA, buffer, bufferIndex);
        if (pdTRUE == xQueueSendFromISR(__queue, &message, &xHigherPriorityTaskWoken)) {
            if (xHigherPriorityTaskWoken) {
                taskYIELD();
            }
        } else {
            __gsmDestroyMessage(message);
        }
        isCSQ = 0;
        bufferIndex = 0;
    } else if (data != 0x0D) {
        buffer[bufferIndex++] = data;
    }
}
开发者ID:masuchen,项目名称:chargingmachine,代码行数:20,代码来源:gsm.C

示例11: Timer_GetTime

/******** Timer_GetCCPPeriod ************************************************
// Count the number of system ticks during one period of CCP input frequency										
// Input: timer is one of the Timer_T value ( Timer1A, Timer1B... )
// Output: none										
// ------------------------------------------------------------------------*/
void Timer_GetCCPPeriod	( Timer_T timer )
{
	unsigned long ticks = 0;
	static unsigned long last_time = 0;
	static unsigned long this_time = 0;
	static char counter = 0;
	portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;

	if ( counter )
	{
		// finish
		this_time = Timer_GetTime ( timer );

		if ( this_time >= last_time )
		{
			// sysTick overflow, flush data
			last_time = 0;
			this_time = 0;
			counter = 0;
		}
		else
		{
			// get the number of ticks in a period, push on to the Queue
			ticks = last_time - this_time;
			while ( xQueueSendFromISR (CCPQueue[timer], &ticks, &xHigherPriorityTaskWoken) != pdTRUE );

			// reset ISR and disable interrupt
			counter = 0;
			Timer_Disable ( timer ) ;
		}

	}
	else
	{
		// begin
		last_time = Timer_GetTime ( timer );

		// next interrupt will finish system tick calculation
		counter = 1;
	}
}
开发者ID:yguo89,项目名称:RTOS,代码行数:46,代码来源:Timers.c

示例12: vEINT0_ISR_Handler

/*
 * When the WIZnet device asserts an interrupt we send an (empty) message to
 * the TCP task.  This wakes the task so the interrupt can be processed.  The
 * source of the interrupt has to be ascertained by the TCP task as this 
 * requires an I2C transaction which cannot be performed from this ISR.
 * Note this code predates the introduction of semaphores, a semaphore should
 * be used in place of the empty queue message.
 */
void vEINT0_ISR_Handler( void )
{
extern xQueueHandle xTCPISRQueue;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;

	/* Just wake the TCP task so it knows an ISR has occurred. */
	xQueueSendFromISR( xTCPISRQueue, ( void * ) &lDummyVariable, &xHigherPriorityTaskWoken );	

	/* We cannot carry on processing interrupts until the TCP task has 
	processed this one - so for now interrupts are disabled.  The TCP task will
	re-enable it. */
	VICIntEnClear |= tcpEINT0_VIC_CHANNEL_BIT;

	/* Clear the interrupt bit. */	
	VICVectAddr = tcpCLEAR_VIC_INTERRUPT;

	if( xHigherPriorityTaskWoken )
	{
		portYIELD_FROM_ISR();
	}
}
开发者ID:niesteszeck,项目名称:FreeRTOS,代码行数:29,代码来源:TCPISR.c

示例13: tdcMeasurementHandler

/**
 * \brief	TDC interrupt handler, called after the propagation delay measurement.
 */
void tdcMeasurementHandler(void) {
	uint32_t result;
	event_t error_event;
	BaseType_t xTaskWoken = pdFALSE;

	/* Check the pointer */
	if (g_rawDataPtr != NULL) {
		/* Read the calibration value */
		bsp_GP22RegRead(GP22_RD_RES_0, &result, 4);
		/* Safe the raw data */
		g_rawDataPtr->raw[g_rawDataPtr->raw_ctr++] = result;
	}
	else {
		/* Send error event */
		error_event.event = Fault_MemoryPoolPtr;
		xQueueSendFromISR(queueEvent, &error_event, &xTaskWoken);
	}

	/* Check if a higher prior task is woken up */
	portEND_SWITCHING_ISR(xTaskWoken);
}
开发者ID:funshine,项目名称:LIDAR,代码行数:24,代码来源:task_dataacquisition.c

示例14: r_scifa2_callback_receiveend

/***********************************************************************************************************************
* Function Name: r_scifa2_callback_receiveend
* Description  : This function is a callback function when SCIFA2 finishes reception.
* Arguments    : None
* Return Value : None
***********************************************************************************************************************/
void r_scifa2_callback_receiveend(void)
{
    /* Start user code. Do not edit comment generated here */
    uint8_t ucRxedChar = 0;
    BaseType_t xHigherPriorityTaskWoken = pdFALSE;

    /* Read the received data */
    ucRxedChar = SCIFA2.FRDR;

    /* Characters received from the UART are stored in this queue, ready to be
    received by the application.  ***NOTE*** Using a queue in this way is very
    convenient, but also very inefficient.  It can be used here because
    characters will only arrive slowly.  In a higher bandwidth system a circular
    RAM buffer or DMA should be used in place of this queue. */
    xQueueSendFromISR( xRxQueue, ( void * ) &ucRxedChar, &xHigherPriorityTaskWoken );

    /* Re-enable receptions */
    SCIFA2.SCR.BIT.RE = 1U;

    /* End user code. Do not edit comment generated here */
}
开发者ID:peterliu2,项目名称:FreeRTOS,代码行数:27,代码来源:r_cg_scifa_user.c

示例15: vAsyncSerialIODataAvailableISR

/* Define a callback function which is called when data is available. */
void vAsyncSerialIODataAvailableISR( int iFileDescriptor, void *pContext )
{
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
ssize_t iReadResult = -1;
unsigned char ucRx;

	/* This handler only processes a single byte/character at a time. */
	iReadResult = read( iFileDescriptor, &ucRx, 1 );
	if ( 1 == iReadResult )
	{
		if ( NULL != pContext )
		{
			/* Send the received byte to the queue. */
			if ( pdTRUE != xQueueSendFromISR( (xQueueHandle)pContext, &ucRx, &xHigherPriorityTaskWoken ) )
			{
				/* the queue is full. */
			}
		}
	}
	portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
}
开发者ID:EmuxEvans,项目名称:CompositeFreeRTOS,代码行数:22,代码来源:AsyncIOSerial.c


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