diff options
| author | Ulf Lilleengen <[email protected]> | 2024-05-18 10:17:03 +0200 |
|---|---|---|
| committer | Ulf Lilleengen <[email protected]> | 2024-05-21 10:05:21 +0200 |
| commit | 739e5861c2e47db251725163fcd91cd822cf97b7 (patch) | |
| tree | 947dc7961ca7c42ec216056fc2adf616ab812b10 /docs/modules/ROOT/examples/layer-by-layer/blinky-async/src/main.rs | |
| parent | 51d553092550059afb22b2620cea14bbed21abff (diff) | |
convert from antora to asciidoctor
Diffstat (limited to 'docs/modules/ROOT/examples/layer-by-layer/blinky-async/src/main.rs')
| -rw-r--r-- | docs/modules/ROOT/examples/layer-by-layer/blinky-async/src/main.rs | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/docs/modules/ROOT/examples/layer-by-layer/blinky-async/src/main.rs b/docs/modules/ROOT/examples/layer-by-layer/blinky-async/src/main.rs deleted file mode 100644 index 004602816..000000000 --- a/docs/modules/ROOT/examples/layer-by-layer/blinky-async/src/main.rs +++ /dev/null | |||
| @@ -1,23 +0,0 @@ | |||
| 1 | #![no_std] | ||
| 2 | #![no_main] | ||
| 3 | |||
| 4 | use embassy_executor::Spawner; | ||
| 5 | use embassy_stm32::exti::ExtiInput; | ||
| 6 | use embassy_stm32::gpio::{Level, Output, Pull, Speed}; | ||
| 7 | use {defmt_rtt as _, panic_probe as _}; | ||
| 8 | |||
| 9 | #[embassy_executor::main] | ||
| 10 | async fn main(_spawner: Spawner) { | ||
| 11 | let p = embassy_stm32::init(Default::default()); | ||
| 12 | let mut led = Output::new(p.PB14, Level::Low, Speed::VeryHigh); | ||
| 13 | let mut button = ExtiInput::new(p.PC13, p.EXTI13, Pull::Up); | ||
| 14 | |||
| 15 | loop { | ||
| 16 | button.wait_for_any_edge().await; | ||
| 17 | if button.is_low() { | ||
| 18 | led.set_high(); | ||
| 19 | } else { | ||
| 20 | led.set_low(); | ||
| 21 | } | ||
| 22 | } | ||
| 23 | } | ||
