[BSP]changed stm32f10x uart driver. make sure the serial transmit
complete in putc().
This commit is contained in:
parent
131c41d182
commit
79c37cb30f
@ -12,6 +12,7 @@
|
|||||||
* 2009-01-05 Bernard the first version
|
* 2009-01-05 Bernard the first version
|
||||||
* 2010-03-29 Bernard remove interrupt Tx and DMA Rx mode
|
* 2010-03-29 Bernard remove interrupt Tx and DMA Rx mode
|
||||||
* 2013-05-13 aozima update for kehong-lingtai.
|
* 2013-05-13 aozima update for kehong-lingtai.
|
||||||
|
* 2015-01-31 armink make sure the serial transmit complete in putc()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "stm32f10x.h"
|
#include "stm32f10x.h"
|
||||||
@ -118,8 +119,8 @@ static int stm32_putc(struct rt_serial_device *serial, char c)
|
|||||||
RT_ASSERT(serial != RT_NULL);
|
RT_ASSERT(serial != RT_NULL);
|
||||||
uart = (struct stm32_uart *)serial->parent.user_data;
|
uart = (struct stm32_uart *)serial->parent.user_data;
|
||||||
|
|
||||||
while (!(uart->uart_device->SR & USART_FLAG_TXE));
|
|
||||||
uart->uart_device->DR = c;
|
uart->uart_device->DR = c;
|
||||||
|
while (!(uart->uart_device->SR & USART_FLAG_TC));
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user