We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 131c41d commit 79c37cbCopy full SHA for 79c37cb
bsp/stm32f10x/drivers/usart.c
@@ -12,6 +12,7 @@
12
* 2009-01-05 Bernard the first version
13
* 2010-03-29 Bernard remove interrupt Tx and DMA Rx mode
14
* 2013-05-13 aozima update for kehong-lingtai.
15
+ * 2015-01-31 armink make sure the serial transmit complete in putc()
16
*/
17
18
#include "stm32f10x.h"
@@ -118,8 +119,8 @@ static int stm32_putc(struct rt_serial_device *serial, char c)
118
119
RT_ASSERT(serial != RT_NULL);
120
uart = (struct stm32_uart *)serial->parent.user_data;
121
- while (!(uart->uart_device->SR & USART_FLAG_TXE));
122
uart->uart_device->DR = c;
123
+ while (!(uart->uart_device->SR & USART_FLAG_TC));
124
125
return 1;
126
}
0 commit comments