/* Wait until Receive enable acknowledge flag is set */
while(USART_GetFlagStatus(cCOM1, USART_FLAG_REACK) == RESET);
/* Wait until Transmit enable acknowledge flag is set */
while(USART_GetFlagStatus(cCOM1, USART_FLAG_TEACK) == RESET);
lubTaskID = 1;
break;
}
case 1:
{
/* Loop until the end of Autobaudrate phase */
if(USART_GetFlagStatus(cCOM1, USART_FLAG_ABRF) != RESET)
lubTaskID = 2;
break;
}
case 2:
{
/* If AutoBaudRate error occurred */
if(USART_GetFlagStatus(cCOM1, USART_FLAG_ABRE) == RESET)
{
/* Wait until RXNE flag is set */
while(USART_GetFlagStatus(cCOM1, USART_FLAG_RXNE) == RESET);
/* Wait until TXE flag is set */
while(USART_GetFlagStatus(cCOM1, USART_FLAG_TXE) == RESET);
/* Send received character */
USART_SendData(cCOM1, USART_ReceiveData(cCOM1));
/* clear the TE bit */
//USART_DirectionModeCmd(cCOM1, USART_Mode_Tx, DISABLE);
/* Check the Transfer Complete Flag */
while(USART_GetFlagStatus(cCOM1, USART_FLAG_TC) == RESET);
}