/**
*******************************************************************************
** \brief USART1 RX irq callback function.
**
** \param [in] None
**
** \retval None
**
******************************************************************************/
static void USART1_RX_Callback(void)
{
uint8_t data;
if(USART_GetStatus(M4_USART1,UsartRxNoEmpty))
{
data =USART_RecData(M4_USART1);
RecTimeOut = 0;
if(RecLen<100)
{
usart_rec[ RecLen ] = data;
RecLen++;
}
}
if (Set == USART_GetStatus(M4_USART1, UsartFrameErr))
{
USART_ClearStatus(M4_USART1, UsartFrameErr);
}
if (Set == USART_GetStatus(M4_USART1, UsartParityErr))
{
USART_ClearStatus(M4_USART1, UsartParityErr);
}
if (Set == USART_GetStatus(M4_USART1, UsartOverrunErr))
{
USART_ClearStatus(M4_USART1, UsartOverrunErr);
}
}
|