diff options
| author | Dario Nieuwenhuis <[email protected]> | 2021-06-25 06:43:22 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-06-25 06:43:22 +0200 |
| commit | e6d6e82e54bca88ab1144802d2b716b867934225 (patch) | |
| tree | a143abef212ecf51582e54b13a93da3c95ef0ed0 /examples | |
| parent | a35c8561c7dfafeabe10877a94f8519174dfe4c7 (diff) | |
| parent | 88bc2972f6c1b345d06618137fc6a1e22aeeee51 (diff) | |
Merge pull request #257 from embassy-rs/rp-clocks
rp: fixes and add SPi
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/rp/src/bin/blinky.rs | 5 | ||||
| -rw-r--r-- | examples/rp/src/bin/button.rs | 6 |
2 files changed, 5 insertions, 6 deletions
diff --git a/examples/rp/src/bin/blinky.rs b/examples/rp/src/bin/blinky.rs index e42999912..a162ed2f7 100644 --- a/examples/rp/src/bin/blinky.rs +++ b/examples/rp/src/bin/blinky.rs | |||
| @@ -12,7 +12,6 @@ mod example_common; | |||
| 12 | use defmt::*; | 12 | use defmt::*; |
| 13 | use embassy::executor::Spawner; | 13 | use embassy::executor::Spawner; |
| 14 | use embassy_rp::{gpio, Peripherals}; | 14 | use embassy_rp::{gpio, Peripherals}; |
| 15 | use embedded_hal::digital::v2::OutputPin; | ||
| 16 | use gpio::{Level, Output}; | 15 | use gpio::{Level, Output}; |
| 17 | 16 | ||
| 18 | #[embassy::main] | 17 | #[embassy::main] |
| @@ -21,11 +20,11 @@ async fn main(_spawner: Spawner, p: Peripherals) { | |||
| 21 | 20 | ||
| 22 | loop { | 21 | loop { |
| 23 | info!("led on!"); | 22 | info!("led on!"); |
| 24 | led.set_high().unwrap(); | 23 | led.set_high(); |
| 25 | cortex_m::asm::delay(1_000_000); | 24 | cortex_m::asm::delay(1_000_000); |
| 26 | 25 | ||
| 27 | info!("led off!"); | 26 | info!("led off!"); |
| 28 | led.set_low().unwrap(); | 27 | led.set_low(); |
| 29 | cortex_m::asm::delay(1_000_000); | 28 | cortex_m::asm::delay(1_000_000); |
| 30 | } | 29 | } |
| 31 | } | 30 | } |
diff --git a/examples/rp/src/bin/button.rs b/examples/rp/src/bin/button.rs index c4d942ff5..12bc0e0d9 100644 --- a/examples/rp/src/bin/button.rs +++ b/examples/rp/src/bin/button.rs | |||
| @@ -20,10 +20,10 @@ async fn main(_spawner: Spawner, p: Peripherals) { | |||
| 20 | let mut led = Output::new(p.PIN_25, Level::Low); | 20 | let mut led = Output::new(p.PIN_25, Level::Low); |
| 21 | 21 | ||
| 22 | loop { | 22 | loop { |
| 23 | if button.is_high().unwrap() { | 23 | if button.is_high() { |
| 24 | led.set_high().unwrap(); | 24 | led.set_high(); |
| 25 | } else { | 25 | } else { |
| 26 | led.set_low().unwrap(); | 26 | led.set_low(); |
| 27 | } | 27 | } |
| 28 | } | 28 | } |
| 29 | } | 29 | } |
