diff options
| author | Ulf Lilleengen <[email protected]> | 2022-01-24 12:54:09 +0100 |
|---|---|---|
| committer | Ulf Lilleengen <[email protected]> | 2022-02-09 10:50:29 +0100 |
| commit | ed2a87a262e0e8c091627c96ced981dd3a97a6a1 (patch) | |
| tree | e4202eb8044b534215aa9aa68b79ab83b9e9afc4 /examples/boot/src/bin/b.rs | |
| parent | d91bd0b9a69b8411f2a1d58bfad5d4dce51e7110 (diff) | |
Add embassy-boot
Embassy-boot is a simple bootloader that works together with an
application to provide firmware update capabilities with a minimal risk.
The bootloader consists of a platform-independent part, which implements
the swap algorithm, and a platform-dependent part (currently only for
nRF) that provides addition functionality such as watchdog timers
softdevice support.
Diffstat (limited to 'examples/boot/src/bin/b.rs')
| -rw-r--r-- | examples/boot/src/bin/b.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/examples/boot/src/bin/b.rs b/examples/boot/src/bin/b.rs new file mode 100644 index 000000000..18bb6330c --- /dev/null +++ b/examples/boot/src/bin/b.rs | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | #![no_std] | ||
| 2 | #![no_main] | ||
| 3 | #![macro_use] | ||
| 4 | #![feature(generic_associated_types)] | ||
| 5 | #![feature(type_alias_impl_trait)] | ||
| 6 | |||
| 7 | use embassy::time::{Duration, Timer}; | ||
| 8 | use embassy_nrf::{ | ||
| 9 | gpio::{Level, Output, OutputDrive}, | ||
| 10 | Peripherals, | ||
| 11 | }; | ||
| 12 | |||
| 13 | use panic_reset as _; | ||
| 14 | |||
| 15 | #[embassy::main] | ||
| 16 | async fn main(_s: embassy::executor::Spawner, p: Peripherals) { | ||
| 17 | let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); | ||
| 18 | //let mut led = Output::new(p.P1_10, Level::Low, OutputDrive::Standard); | ||
| 19 | |||
| 20 | loop { | ||
| 21 | led.set_high(); | ||
| 22 | Timer::after(Duration::from_millis(300)).await; | ||
| 23 | led.set_low(); | ||
| 24 | Timer::after(Duration::from_millis(300)).await; | ||
| 25 | } | ||
| 26 | } | ||
