示例#1
0
/*******************************************************************************
* Function Name  : USART1_IRQHandler
* Description    : This function handles USART1 global interrupt request.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
void USART1_IRQHandler(void)
{
	if (USART_GetITStatus(USART1, USART_IT_RXNE) != RESET) {
		/* Send the received data to the PC Host*/
		USART_To_USB_Send_Data();
	}

	/* If overrun condition occurs, clear the ORE flag and recover communication */
	if (USART_GetFlagStatus(USART1, USART_FLAG_ORE) != RESET) {
		(void)USART_ReceiveData(USART1);
	}



#if	0
	uint32_t t=1;
	uint8_t value=1;
	uint8_t *addr=0;
	t = __STREXB(value,addr);
	(void) t;

	uint32_t u=1;
	uint16_t value2=1;
	uint16_t *addr2=0;
	u = __STREXH(value2,addr2);
	(void) u;

	uint32_t v=1;
	uint32_t value3=1;
	uint32_t *addr3=0;
	v = __STREXW(value3,addr3);
	(void) v;
#endif

}
示例#2
0
/*******************************************************************************
* Function Name  : USART2_IRQHandler
* Description    : This function handles USART2 global interrupt request.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
void USART2_IRQHandler(void)
{
	if (USART_GetITStatus(USART2, USART_IT_RXNE) != RESET) {
		/* Send the received data to the PC Host*/
		USART_To_USB_Send_Data();
	}

	/* If overrun condition occurs, clear the ORE flag and recover communication */
	if (USART_GetFlagStatus(USART2, USART_FLAG_ORE) != RESET) {
		(void)USART_ReceiveData(USART2);
	}
}
示例#3
0
void EVAL_COM2_IRQHandler(void)
{
extern int bypass_mode;
	if (USART_GetITStatus(EVAL_COM2, USART_IT_RXNE) != RESET)
	{
		if(bypass_mode)
		USART_To_USB_Send_Data();
		else
		usart_2_rx_buffer(USART_ReceiveData(EVAL_COM2));
		
	
	}

	/* If overrun condition occurs, clear the ORE flag and recover communication */
	if (USART_GetFlagStatus(EVAL_COM2, USART_FLAG_ORE) != RESET)
	{
		(void)USART_ReceiveData(EVAL_COM2);
	}


}