diff options
| author | Ben Gamari <[email protected]> | 2021-07-31 11:51:40 -0400 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2021-08-05 22:39:59 +0200 |
| commit | f4950c44499b2d1ba1280000a05a1a5edd03d8ca (patch) | |
| tree | ba2c93392868fe6910868d1d5d58562760ed0ab7 /examples/stm32h7/src | |
| parent | 36402b5487a7001c859bf85673e74c64cc2b59cd (diff) | |
examples: Consistently use unwrap! in favor of .unwrap()
Unfortunately errors from `embedded_graphics` and `core` doesn't provide
the necessary instances currently.
Diffstat (limited to 'examples/stm32h7/src')
| -rw-r--r-- | examples/stm32h7/src/bin/blinky.rs | 4 | ||||
| -rw-r--r-- | examples/stm32h7/src/bin/usart.rs | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/examples/stm32h7/src/bin/blinky.rs b/examples/stm32h7/src/bin/blinky.rs index b5e0c18a5..09b34eacb 100644 --- a/examples/stm32h7/src/bin/blinky.rs +++ b/examples/stm32h7/src/bin/blinky.rs | |||
| @@ -24,11 +24,11 @@ async fn main(_spawner: Spawner, p: Peripherals) { | |||
| 24 | 24 | ||
| 25 | loop { | 25 | loop { |
| 26 | info!("high"); | 26 | info!("high"); |
| 27 | led.set_high().unwrap(); | 27 | unwrap!(led.set_high()); |
| 28 | Timer::after(Duration::from_millis(500)).await; | 28 | Timer::after(Duration::from_millis(500)).await; |
| 29 | 29 | ||
| 30 | info!("low"); | 30 | info!("low"); |
| 31 | led.set_low().unwrap(); | 31 | unwrap!(led.set_low()); |
| 32 | Timer::after(Duration::from_millis(500)).await; | 32 | Timer::after(Duration::from_millis(500)).await; |
| 33 | } | 33 | } |
| 34 | } | 34 | } |
diff --git a/examples/stm32h7/src/bin/usart.rs b/examples/stm32h7/src/bin/usart.rs index 9c93d3f22..a3fcc6d3f 100644 --- a/examples/stm32h7/src/bin/usart.rs +++ b/examples/stm32h7/src/bin/usart.rs | |||
| @@ -23,13 +23,13 @@ async fn main_task() { | |||
| 23 | let config = Config::default(); | 23 | let config = Config::default(); |
| 24 | let mut usart = Uart::new(p.UART7, p.PF6, p.PF7, NoDma, NoDma, config); | 24 | let mut usart = Uart::new(p.UART7, p.PF6, p.PF7, NoDma, NoDma, config); |
| 25 | 25 | ||
| 26 | usart.bwrite_all(b"Hello Embassy World!\r\n").unwrap(); | 26 | unwrap!(usart.bwrite_all(b"Hello Embassy World!\r\n")); |
| 27 | info!("wrote Hello, starting echo"); | 27 | info!("wrote Hello, starting echo"); |
| 28 | 28 | ||
| 29 | let mut buf = [0u8; 1]; | 29 | let mut buf = [0u8; 1]; |
| 30 | loop { | 30 | loop { |
| 31 | usart.read_blocking(&mut buf).unwrap(); | 31 | unwrap!(usart.read_blocking(&mut buf)); |
| 32 | usart.bwrite_all(&buf).unwrap(); | 32 | unwrap!(usart.bwrite_all(&buf)); |
| 33 | } | 33 | } |
| 34 | } | 34 | } |
| 35 | 35 | ||
