aboutsummaryrefslogtreecommitdiff
path: root/examples/boot/application/stm32l4/src/bin/b.rs
diff options
context:
space:
mode:
authorUlf Lilleengen <[email protected]>2022-06-24 19:56:15 +0200
committerUlf Lilleengen <[email protected]>2022-06-24 19:56:15 +0200
commit776be79f7bb10b09e795e2ea93bb795a653c9b4c (patch)
tree269046d330ee503c84049bb8fc47baf0297ecb80 /examples/boot/application/stm32l4/src/bin/b.rs
parent84628d36cf743193cbf0e7d47ef1cfa9fb590890 (diff)
Move bootloader main to examples
This should remove some confusion around embassy-boot-* being a library vs. a binary. The binary is now an example bootloader instead.
Diffstat (limited to 'examples/boot/application/stm32l4/src/bin/b.rs')
-rw-r--r--examples/boot/application/stm32l4/src/bin/b.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/boot/application/stm32l4/src/bin/b.rs b/examples/boot/application/stm32l4/src/bin/b.rs
new file mode 100644
index 000000000..4487e586e
--- /dev/null
+++ b/examples/boot/application/stm32l4/src/bin/b.rs
@@ -0,0 +1,24 @@
1#![no_std]
2#![no_main]
3#![feature(type_alias_impl_trait)]
4
5#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*;
7use embassy::executor::Spawner;
8use embassy::time::{Duration, Timer};
9use embassy_stm32::gpio::{Level, Output, Speed};
10use embassy_stm32::Peripherals;
11use panic_reset as _;
12
13#[embassy::main]
14async fn main(_spawner: Spawner, p: Peripherals) {
15 let mut led = Output::new(p.PA5, Level::High, Speed::Low);
16
17 loop {
18 led.set_high();
19 Timer::after(Duration::from_millis(500)).await;
20
21 led.set_low();
22 Timer::after(Duration::from_millis(500)).await;
23 }
24}