diff options
| author | Marti Bolivar <mbolivar@leaflabs.com> | 2011-04-07 23:10:50 -0400 |
|---|---|---|
| committer | Marti Bolivar <mbolivar@leaflabs.com> | 2011-04-08 18:57:14 -0400 |
| commit | c17e4bdd4a0504039c9c6475056eae918df0be17 (patch) | |
| tree | 80978d20bd37a89c642a1f85ea7bcc271df58e25 /libmaple | |
| parent | 457e3f30d1fc28feb10716d4163abd74397c2b2c (diff) | |
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.c | 4 |
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); |
