aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-04-07 23:10:50 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2011-04-08 18:57:14 -0400
commit308b5c8f36f517f5c62cd037124982a45e7b5fa1 (patch)
tree53e70c7cd9e1f7b8363fb592bd8fb5b35a153603 /libmaple
parent686f12ad6728fec15129a98f5d1ec182bab4c6b9 (diff)
downloadlibrambutan-308b5c8f36f517f5c62cd037124982a45e7b5fa1.tar.gz
librambutan-308b5c8f36f517f5c62cd037124982a45e7b5fa1.zip
USART fixups.
* usart_enable(): Doxygen comment bugfix. * usart_disable(): previously, usart_disable() would nuke the entire CR1 register just to clear the UE bit.
Diffstat (limited to 'libmaple')
-rw-r--r--libmaple/usart.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libmaple/usart.c b/libmaple/usart.c
index df5e2c5..de808a7 100644
--- a/libmaple/usart.c
+++ b/libmaple/usart.c
@@ -120,7 +120,7 @@ void usart_set_baud_rate(usart_dev *dev, uint32 clock_speed, uint32 baud) {
* @brief Enable a serial port.
*
* USART is enabled in single buffer transmission mode, multibuffer
- * receiver mode, at the given baud rate, 8n1.
+ * receiver mode, 8n1.
*
* Serial port must have a baud rate configured to work properly.
*
@@ -146,7 +146,7 @@ void usart_disable(usart_dev *dev) {
;
/* Disable UE */
- regs->CR1 = 0;
+ regs->CR1 &= ~USART_CR1_UE;
/* Clean up buffer */
usart_reset_rx(dev);