Exemplo n.º 1
0
void USART1_IRQHandler(void)
{
    if(USART_GetITStatus(J_UART, USART_IT_RXNE))
	{
        USART_ClearFlag(J_UART, USART_FLAG_RXNE);
        uart_get_data(); 
	}
}
Exemplo n.º 2
0
void VCOM_bridge(void)
{
	uint32_t recv_count;
	recv_count = CDC_Device_BytesReceived(&VirtualSerial_CDC_Interface);
	while(recv_count--)
	{
		out_buff[0] = CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface);
		uart_send_byte(out_buff[0]);
	}
	recv_count = uart_get_data(in_buff);
	if(recv_count)
	{
		CDC_Device_SendData(&VirtualSerial_CDC_Interface, (char *)in_buff, recv_count);
		Endpoint_ClearIN();
	}
}