diff options
Diffstat (limited to 'examples/src/bin/uart.rs')
| -rw-r--r-- | examples/src/bin/uart.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/src/bin/uart.rs b/examples/src/bin/uart.rs index eeaf5fee6..553bbb356 100644 --- a/examples/src/bin/uart.rs +++ b/examples/src/bin/uart.rs | |||
| @@ -17,7 +17,7 @@ use embassy_nrf::uarte; | |||
| 17 | 17 | ||
| 18 | #[task] | 18 | #[task] |
| 19 | async fn run() { | 19 | async fn run() { |
| 20 | let p = embassy_nrf::pac::Peripherals::take().dewrap(); | 20 | let p = unwrap!(embassy_nrf::pac::Peripherals::take()); |
| 21 | 21 | ||
| 22 | let port0 = gpio::p0::Parts::new(p.P0); | 22 | let port0 = gpio::p0::Parts::new(p.P0); |
| 23 | 23 | ||
| @@ -41,14 +41,14 @@ async fn run() { | |||
| 41 | 41 | ||
| 42 | info!("uarte initialized!"); | 42 | info!("uarte initialized!"); |
| 43 | 43 | ||
| 44 | u.write_all(b"Hello!\r\n").await.dewrap(); | 44 | unwrap!(u.write_all(b"Hello!\r\n").await); |
| 45 | info!("wrote hello in uart!"); | 45 | info!("wrote hello in uart!"); |
| 46 | 46 | ||
| 47 | // Simple demo, reading 8-char chunks and echoing them back reversed. | 47 | // Simple demo, reading 8-char chunks and echoing them back reversed. |
| 48 | loop { | 48 | loop { |
| 49 | info!("reading..."); | 49 | info!("reading..."); |
| 50 | let mut buf = [0u8; 8]; | 50 | let mut buf = [0u8; 8]; |
| 51 | u.read_exact(&mut buf).await.dewrap(); | 51 | unwrap!(u.read_exact(&mut buf).await); |
| 52 | info!("read done, got {:[u8]}", buf); | 52 | info!("read done, got {:[u8]}", buf); |
| 53 | 53 | ||
| 54 | // Reverse buf | 54 | // Reverse buf |
| @@ -59,7 +59,7 @@ async fn run() { | |||
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | info!("writing..."); | 61 | info!("writing..."); |
| 62 | u.write_all(&buf).await.dewrap(); | 62 | unwrap!(u.write_all(&buf).await); |
| 63 | info!("write done"); | 63 | info!("write done"); |
| 64 | } | 64 | } |
| 65 | } | 65 | } |
| @@ -70,8 +70,8 @@ static EXECUTOR: Forever<Executor> = Forever::new(); | |||
| 70 | fn main() -> ! { | 70 | fn main() -> ! { |
| 71 | info!("Hello World!"); | 71 | info!("Hello World!"); |
| 72 | 72 | ||
| 73 | let executor = EXECUTOR.put(Executor::new(cortex_m::asm::wfi)); | 73 | let executor = EXECUTOR.put(Executor::new(cortex_m::asm::sev)); |
| 74 | executor.spawn(run()).dewrap(); | 74 | unwrap!(executor.spawn(run())); |
| 75 | 75 | ||
| 76 | loop { | 76 | loop { |
| 77 | executor.run(); | 77 | executor.run(); |
