examples: Consistently use unwrap! in favor of .unwrap()

Unfortunately errors from `embedded_graphics` and `core` doesn't provide
the necessary instances currently.
This commit is contained in:
Ben Gamari
2021-07-31 11:51:40 -04:00
committed by Dario Nieuwenhuis
parent 36402b5487
commit f4950c4449
22 changed files with 67 additions and 65 deletions

View File

@ -24,11 +24,11 @@ async fn main(_spawner: Spawner, p: Peripherals) {
loop {
info!("high");
led.set_high().unwrap();
unwrap!(led.set_high());
Timer::after(Duration::from_millis(500)).await;
info!("low");
led.set_low().unwrap();
unwrap!(led.set_low());
Timer::after(Duration::from_millis(500)).await;
}
}

View File

@ -23,13 +23,13 @@ async fn main_task() {
let config = Config::default();
let mut usart = Uart::new(p.UART7, p.PF6, p.PF7, NoDma, NoDma, config);
usart.bwrite_all(b"Hello Embassy World!\r\n").unwrap();
unwrap!(usart.bwrite_all(b"Hello Embassy World!\r\n"));
info!("wrote Hello, starting echo");
let mut buf = [0u8; 1];
loop {
usart.read_blocking(&mut buf).unwrap();
usart.bwrite_all(&buf).unwrap();
unwrap!(usart.read_blocking(&mut buf));
unwrap!(usart.bwrite_all(&buf));
}
}