aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/STM32/serial_lld.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-01-22 14:13:49 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-01-22 14:13:49 +0000
commit00f3c1b8f39f99fc326d2460abb39a7e868becfa (patch)
treecb16ef1114779b41e1778e8af8658ca1c0f8f614 /os/hal/platforms/STM32/serial_lld.c
parent1b43d44a84f4ee8ca1dc720c4b5d3b7b2e87e0e4 (diff)
downloadChibiOS-00f3c1b8f39f99fc326d2460abb39a7e868becfa.tar.gz
ChibiOS-00f3c1b8f39f99fc326d2460abb39a7e868becfa.tar.bz2
ChibiOS-00f3c1b8f39f99fc326d2460abb39a7e868becfa.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2672 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32/serial_lld.c')
-rw-r--r--os/hal/platforms/STM32/serial_lld.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/os/hal/platforms/STM32/serial_lld.c b/os/hal/platforms/STM32/serial_lld.c
index 1d45315cc..1096efecd 100644
--- a/os/hal/platforms/STM32/serial_lld.c
+++ b/os/hal/platforms/STM32/serial_lld.c
@@ -98,7 +98,8 @@ static void usart_init(SerialDriver *sdp, const SerialConfig *config) {
* Note that some bits are enforced.
*/
u->CR1 = config->sc_cr1 | USART_CR1_UE | USART_CR1_PEIE |
- USART_CR1_RXNEIE | USART_CR1_RE;
+ USART_CR1_RXNEIE | USART_CR1_TE |
+ USART_CR1_RE;
u->CR2 = config->sc_cr2 | USART_CR2_LBDIE;
u->CR3 = config->sc_cr3 | USART_CR3_EIE;
u->SR = 0;
@@ -175,10 +176,8 @@ static void serve_interrupt(SerialDriver *sdp) {
chIOAddFlagsI(sdp, IO_OUTPUT_EMPTY);
u->CR1 = cr1 & ~USART_CR1_TXEIE;
}
- else {
+ else
u->DR = b;
- u->CR1 = cr1 | USART_CR1_TE;
- }
chSysUnlockFromIsr();
}
}