void USART1_IRQHandler(void)
{
uint8_t ch=0;
if( USART_GetIntBitState(USART1, USART_INT_RBNE) != RESET)
{
/* Read one byte from the receive data register */
//RxBuffer[ RxCounter++ ] = ( uint8_t )USART_DataReceive( USART1 );
ch = ( uint8_t )USART_DataReceive( USART1 );
USART_DataSend( USART1 , ch );
RxBuffer[ RxCounter++ ]=ch;
if(ch==0x0a || ch==0x0d){
//USART_DataSend( USART1 , "
" );
uart_cmd=1;
USART_INT_Set( USART1 , USART_INT_RBNE , DISABLE );
}
//if( RxCounter >= NbrOfDataToRead )
//{
/* Disable the USARTy Receive interrupt */
// USART_INT_Set( USART1 , USART_INT_RBNE , DISABLE );
//}
}
#if 0
if( USART_GetIntBitState( USART1, USART_INT_TBE ) != RESET )
{
/* Write one byte to the transmit data register */
USART_DataSend( USART1 , TxBuffer[ TxCounter ++ ] );
if( TxCounter >= NbrOfDataToSend )
{
/* Disable the USART1 Transmit interrupt */
USART_INT_Set(USART1, USART_INT_TBE, DISABLE);
}
}
#endif
}