diff options
Diffstat (limited to 'os/hal/platforms/STM32/serial_lld.c')
-rw-r--r-- | os/hal/platforms/STM32/serial_lld.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/os/hal/platforms/STM32/serial_lld.c b/os/hal/platforms/STM32/serial_lld.c index 841b9b386..92ef8c5ef 100644 --- a/os/hal/platforms/STM32/serial_lld.c +++ b/os/hal/platforms/STM32/serial_lld.c @@ -222,11 +222,11 @@ static void usart_init(SerialDriver *sdp, const SerialConfig *config) { u->BRR = STM32_PCLK1 / config->sc_speed;
/* Note that some bits are enforced.*/
+ u->CR2 = config->sc_cr2 | USART_CR2_LBDIE;
+ u->CR3 = config->sc_cr3 | USART_CR3_EIE;
u->CR1 = config->sc_cr1 | USART_CR1_UE | USART_CR1_PEIE |
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;
(void)u->SR; /* SR reset step 1.*/
(void)u->DR; /* SR reset step 2.*/
|