stm32/usart: return error instead of panicking on bad baudrate.

This commit is contained in:
Dario Nieuwenhuis
2023-09-26 00:14:52 +02:00
parent c79a84a98a
commit 5d8817d109
22 changed files with 94 additions and 75 deletions

View File

@ -22,7 +22,7 @@ async fn main(_spawner: Spawner) {
info!("Hello World!");
let config = Config::default();
let mut usart = Uart::new(p.USART1, p.PE1, p.PE0, Irqs, p.DMA1_CH4, NoDma, config);
let mut usart = Uart::new(p.USART1, p.PE1, p.PE0, Irqs, p.DMA1_CH4, NoDma, config).unwrap();
for n in 0u32.. {
let mut s: String<128> = String::new();