|
|
|
@ -103,8 +103,12 @@ uint16_t RXSerialfifolevel1()
|
|
|
|
// warning: this call is blocking
|
|
|
|
// warning: this call is blocking
|
|
|
|
void TXSerialFlush1()
|
|
|
|
void TXSerialFlush1()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// wait until the TXE shows the shift register is empty
|
|
|
|
// wait until the TX FIFO has drained
|
|
|
|
while (USART_GetITStatus(USART1, USART_FLAG_TXE))
|
|
|
|
while (TXSerialfifolevel1() > 0U)
|
|
|
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// wait until the TC flag shows the shift register is empty
|
|
|
|
|
|
|
|
while (USART_GetFlagStatus(USART1, USART_FLAG_TC) == RESET)
|
|
|
|
;
|
|
|
|
;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -294,8 +298,12 @@ uint16_t RXSerialfifolevel2()
|
|
|
|
// warning: this call is blocking
|
|
|
|
// warning: this call is blocking
|
|
|
|
void TXSerialFlush2()
|
|
|
|
void TXSerialFlush2()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// wait until the TXE shows the shift register is empty
|
|
|
|
// wait until the TX FIFO has drained
|
|
|
|
while (USART_GetITStatus(USART2, USART_FLAG_TXE))
|
|
|
|
while (TXSerialfifolevel2() > 0U)
|
|
|
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// wait until the TC flag shows the shift register is empty
|
|
|
|
|
|
|
|
while (USART_GetFlagStatus(USART2, USART_FLAG_TC) == RESET)
|
|
|
|
;
|
|
|
|
;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|