diff options
| -rw-r--r-- | embassy-stm32/src/usart/mod.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/embassy-stm32/src/usart/mod.rs b/embassy-stm32/src/usart/mod.rs index 20f4eedeb..f80323e37 100644 --- a/embassy-stm32/src/usart/mod.rs +++ b/embassy-stm32/src/usart/mod.rs | |||
| @@ -770,7 +770,14 @@ fn configure(r: Regs, config: &Config, pclk_freq: Hertz, multiplier: u32, enable | |||
| 770 | 770 | ||
| 771 | unsafe { | 771 | unsafe { |
| 772 | r.brr().write_value(regs::Brr(div)); | 772 | r.brr().write_value(regs::Brr(div)); |
| 773 | r.cr2().write(|_w| {}); | 773 | r.cr2().write(|w| { |
| 774 | w.set_stop(match config.stop_bits { | ||
| 775 | StopBits::STOP0P5 => vals::Stop::STOP0P5, | ||
| 776 | StopBits::STOP1 => vals::Stop::STOP1, | ||
| 777 | StopBits::STOP1P5 => vals::Stop::STOP1P5, | ||
| 778 | StopBits::STOP2 => vals::Stop::STOP2, | ||
| 779 | }); | ||
| 780 | }); | ||
| 774 | r.cr1().write(|w| { | 781 | r.cr1().write(|w| { |
| 775 | // enable uart | 782 | // enable uart |
| 776 | w.set_ue(true); | 783 | w.set_ue(true); |
| @@ -1148,7 +1155,7 @@ macro_rules! impl_lpuart { | |||
| 1148 | 1155 | ||
| 1149 | foreach_interrupt!( | 1156 | foreach_interrupt!( |
| 1150 | ($inst:ident, lpuart, $block:ident, $signal_name:ident, $irq:ident) => { | 1157 | ($inst:ident, lpuart, $block:ident, $signal_name:ident, $irq:ident) => { |
| 1151 | impl_lpuart!($inst, $irq, 255); | 1158 | impl_lpuart!($inst, $irq, 256); |
| 1152 | }; | 1159 | }; |
| 1153 | 1160 | ||
| 1154 | ($inst:ident, usart, $block:ident, $signal_name:ident, $irq:ident) => { | 1161 | ($inst:ident, usart, $block:ident, $signal_name:ident, $irq:ident) => { |
