aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple
diff options
context:
space:
mode:
authorMichael Hope <michaelh@juju.net.nz>2010-10-20 21:06:17 +1300
committerMichael Hope <michaelh@juju.net.nz>2010-10-20 21:06:17 +1300
commitd38ffc1c658476a5c28e3d70ac9abd300f914433 (patch)
treefb71a34b29fd2d0ba1cae826bc844227fe463ca7 /libmaple
parent5b856438167d2f60ceeb295b70bd788874808031 (diff)
downloadlibrambutan-d38ffc1c658476a5c28e3d70ac9abd300f914433.tar.gz
librambutan-d38ffc1c658476a5c28e3d70ac9abd300f914433.zip
Wait until the transmit buffer is empty before send to save time
Diffstat (limited to 'libmaple')
-rw-r--r--libmaple/usart.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/libmaple/usart.h b/libmaple/usart.h
index 593fb8f..cbc7bde 100644
--- a/libmaple/usart.h
+++ b/libmaple/usart.h
@@ -76,11 +76,11 @@ extern struct usart_dev usart_dev_table[];
static inline void usart_putc(uint8 usart_num, uint8 byte) {
usart_port *port = usart_dev_table[usart_num].base;
- port->DR = byte;
-
- /* Wait for transmission to complete */
+ /* Wait for the buffer to empty */
while ((port->SR & USART_TXE) == 0)
;
+
+ port->DR = byte;
}
/**