aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;
}
/**