Home > other >  For help on a serial port to send data over and over again
For help on a serial port to send data over and over again

Time:09-20

I watched a lot of sample code on the Internet, but I discovered via a serial port to send data will try again and again to send, is that I interrupt to write wrong, I also try to remove marks, but also not line, the following is part of the code, a great god, please guide,
 
Uint8_t uint8_t void USART1_SendData4 (uint8_t data1, data2, data3, respectively, uint8_t data4)
{
USART1_SendByte (data1);
USART1_SendByte (data2);
USART1_SendByte (data3);
USART1_SendByte (data4);
USART_ClearFlag (USART1, USART_FLAG_TC);
}

 
Void USART1_SendByte (uint8_t data)
{
USART_SendData (USART1, data);
While (USART_GetFlagStatus (USART1, USART_FLAG_TXE)==RESET);
}

 
Void USART1_IRQHandler ()
{
If (USART_GetITStatus (USART1, USART_IT_RXNE))
{
USART_ClearFlag (USART1, USART_FLAG_ORE);//clean up spilled interrupt
}
}
  • Related