diff options
| -rw-r--r-- | embassy-rp/src/uart/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/embassy-rp/src/uart/mod.rs b/embassy-rp/src/uart/mod.rs index 682243a27..a945f2295 100644 --- a/embassy-rp/src/uart/mod.rs +++ b/embassy-rp/src/uart/mod.rs | |||
| @@ -405,10 +405,6 @@ impl<'d, T: Instance + 'd, M: Mode> Uart<'d, T, M> { | |||
| 405 | Parity::ParityEven => (true, true), | 405 | Parity::ParityEven => (true, true), |
| 406 | }; | 406 | }; |
| 407 | 407 | ||
| 408 | // PL011 needs a (dummy) line control register write to latch in the | ||
| 409 | // divisors. We don't want to actually change LCR contents here. | ||
| 410 | r.uartlcr_h().modify(|_| {}); | ||
| 411 | |||
| 412 | r.uartlcr_h().write(|w| { | 408 | r.uartlcr_h().write(|w| { |
| 413 | w.set_wlen(config.data_bits.bits()); | 409 | w.set_wlen(config.data_bits.bits()); |
| 414 | w.set_stp2(config.stop_bits == StopBits::STOP2); | 410 | w.set_stp2(config.stop_bits == StopBits::STOP2); |
| @@ -458,6 +454,10 @@ impl<'d, T: Instance + 'd, M: Mode> Uart<'d, T, M> { | |||
| 458 | // Load PL011's baud divisor registers | 454 | // Load PL011's baud divisor registers |
| 459 | r.uartibrd().write_value(pac::uart::regs::Uartibrd(baud_ibrd)); | 455 | r.uartibrd().write_value(pac::uart::regs::Uartibrd(baud_ibrd)); |
| 460 | r.uartfbrd().write_value(pac::uart::regs::Uartfbrd(baud_fbrd)); | 456 | r.uartfbrd().write_value(pac::uart::regs::Uartfbrd(baud_fbrd)); |
| 457 | |||
| 458 | // PL011 needs a (dummy) line control register write to latch in the | ||
| 459 | // divisors. We don't want to actually change LCR contents here. | ||
| 460 | r.uartlcr_h().modify(|_| {}); | ||
| 461 | } | 461 | } |
| 462 | } | 462 | } |
| 463 | } | 463 | } |
