diff options
| author | Dario Nieuwenhuis <[email protected]> | 2021-07-13 03:42:35 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-07-13 03:42:35 +0200 |
| commit | 549ddf7fc885946d8b28024363148735d7a88425 (patch) | |
| tree | c96a99138be33048dc73b1c04c6a2532bf11d3ad /examples | |
| parent | b8e23bc74e59b53695d0ed0141b1e31a755ea032 (diff) | |
| parent | 1a4c13cf262869d88a38575eb14abd09900e8e01 (diff) | |
Merge pull request #285 from embassy-rs/rp-spi-clock
RP improvements
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/rp/src/bin/blinky.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/rp/src/bin/blinky.rs b/examples/rp/src/bin/blinky.rs index a162ed2f7..9c4767458 100644 --- a/examples/rp/src/bin/blinky.rs +++ b/examples/rp/src/bin/blinky.rs | |||
| @@ -11,6 +11,7 @@ mod example_common; | |||
| 11 | 11 | ||
| 12 | use defmt::*; | 12 | use defmt::*; |
| 13 | use embassy::executor::Spawner; | 13 | use embassy::executor::Spawner; |
| 14 | use embassy::time::{Duration, Timer}; | ||
| 14 | use embassy_rp::{gpio, Peripherals}; | 15 | use embassy_rp::{gpio, Peripherals}; |
| 15 | use gpio::{Level, Output}; | 16 | use gpio::{Level, Output}; |
| 16 | 17 | ||
| @@ -21,10 +22,10 @@ async fn main(_spawner: Spawner, p: Peripherals) { | |||
| 21 | loop { | 22 | loop { |
| 22 | info!("led on!"); | 23 | info!("led on!"); |
| 23 | led.set_high(); | 24 | led.set_high(); |
| 24 | cortex_m::asm::delay(1_000_000); | 25 | Timer::after(Duration::from_secs(1)).await; |
| 25 | 26 | ||
| 26 | info!("led off!"); | 27 | info!("led off!"); |
| 27 | led.set_low(); | 28 | led.set_low(); |
| 28 | cortex_m::asm::delay(1_000_000); | 29 | Timer::after(Duration::from_secs(1)).await; |
| 29 | } | 30 | } |
| 30 | } | 31 | } |
