aboutsummaryrefslogtreecommitdiff
path: root/examples/boot/application/nrf
diff options
context:
space:
mode:
authorMathias <[email protected]>2022-08-18 21:08:57 +0200
committerMathias <[email protected]>2022-08-18 21:08:57 +0200
commita7d6bc7ba5faef3d711b944baf6c8e3685fdb37e (patch)
treed35085173fb8e4a0ff3b6357e3aaef18c6124e6e /examples/boot/application/nrf
parent9c9b7b1a66dc90a9183886867811d2db57df714c (diff)
parentaefa5275a2ab2cac6caef599e7adb76ce1beeddd (diff)
Merge branch 'master' of https://github.com/embassy-rs/embassy into embassy-rp/dma
Diffstat (limited to 'examples/boot/application/nrf')
-rw-r--r--examples/boot/application/nrf/Cargo.toml5
-rw-r--r--examples/boot/application/nrf/src/bin/a.rs5
-rw-r--r--examples/boot/application/nrf/src/bin/b.rs7
3 files changed, 10 insertions, 7 deletions
diff --git a/examples/boot/application/nrf/Cargo.toml b/examples/boot/application/nrf/Cargo.toml
index dd9bcc093..ef9346639 100644
--- a/examples/boot/application/nrf/Cargo.toml
+++ b/examples/boot/application/nrf/Cargo.toml
@@ -5,7 +5,8 @@ version = "0.1.0"
5 5
6[dependencies] 6[dependencies]
7embassy-util = { version = "0.1.0", path = "../../../../embassy-util" } 7embassy-util = { version = "0.1.0", path = "../../../../embassy-util" }
8embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly"] } 8embassy-executor = { version = "0.1.0", path = "../../../../embassy-executor", features = ["nightly", "integrated-timers"] }
9embassy-time = { version = "0.1.0", path = "../../../../embassy-time", features = ["nightly"] }
9embassy-nrf = { version = "0.1.0", path = "../../../../embassy-nrf", features = ["time-driver-rtc1", "gpiote", "nightly", "nrf52840"] } 10embassy-nrf = { version = "0.1.0", path = "../../../../embassy-nrf", features = ["time-driver-rtc1", "gpiote", "nightly", "nrf52840"] }
10embassy-boot-nrf = { version = "0.1.0", path = "../../../../embassy-boot/nrf" } 11embassy-boot-nrf = { version = "0.1.0", path = "../../../../embassy-boot/nrf" }
11embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" } 12embassy-embedded-hal = { version = "0.1.0", path = "../../../../embassy-embedded-hal" }
@@ -15,5 +16,5 @@ defmt-rtt = { version = "0.3", optional = true }
15panic-reset = { version = "0.1.1" } 16panic-reset = { version = "0.1.1" }
16embedded-hal = { version = "0.2.6" } 17embedded-hal = { version = "0.2.6" }
17 18
18cortex-m = "0.7.3" 19cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] }
19cortex-m-rt = "0.7.0" 20cortex-m-rt = "0.7.0"
diff --git a/examples/boot/application/nrf/src/bin/a.rs b/examples/boot/application/nrf/src/bin/a.rs
index 3044645a8..bd8fa3246 100644
--- a/examples/boot/application/nrf/src/bin/a.rs
+++ b/examples/boot/application/nrf/src/bin/a.rs
@@ -6,15 +6,16 @@
6 6
7use embassy_boot_nrf::FirmwareUpdater; 7use embassy_boot_nrf::FirmwareUpdater;
8use embassy_embedded_hal::adapter::BlockingAsync; 8use embassy_embedded_hal::adapter::BlockingAsync;
9use embassy_executor::Spawner;
9use embassy_nrf::gpio::{Input, Level, Output, OutputDrive, Pull}; 10use embassy_nrf::gpio::{Input, Level, Output, OutputDrive, Pull};
10use embassy_nrf::nvmc::Nvmc; 11use embassy_nrf::nvmc::Nvmc;
11use embassy_nrf::Peripherals;
12use panic_reset as _; 12use panic_reset as _;
13 13
14static APP_B: &[u8] = include_bytes!("../../b.bin"); 14static APP_B: &[u8] = include_bytes!("../../b.bin");
15 15
16#[embassy_executor::main] 16#[embassy_executor::main]
17async fn main(_s: embassy_executor::executor::Spawner, p: Peripherals) { 17async fn main(_spawner: Spawner) {
18 let p = embassy_nrf::init(Default::default());
18 let mut button = Input::new(p.P0_11, Pull::Up); 19 let mut button = Input::new(p.P0_11, Pull::Up);
19 let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); 20 let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard);
20 //let mut led = Output::new(p.P1_10, Level::Low, OutputDrive::Standard); 21 //let mut led = Output::new(p.P1_10, Level::Low, OutputDrive::Standard);
diff --git a/examples/boot/application/nrf/src/bin/b.rs b/examples/boot/application/nrf/src/bin/b.rs
index 2f76d20c6..5394bf0c7 100644
--- a/examples/boot/application/nrf/src/bin/b.rs
+++ b/examples/boot/application/nrf/src/bin/b.rs
@@ -4,13 +4,14 @@
4#![feature(generic_associated_types)] 4#![feature(generic_associated_types)]
5#![feature(type_alias_impl_trait)] 5#![feature(type_alias_impl_trait)]
6 6
7use embassy_executor::time::{Duration, Timer}; 7use embassy_executor::Spawner;
8use embassy_nrf::gpio::{Level, Output, OutputDrive}; 8use embassy_nrf::gpio::{Level, Output, OutputDrive};
9use embassy_nrf::Peripherals; 9use embassy_time::{Duration, Timer};
10use panic_reset as _; 10use panic_reset as _;
11 11
12#[embassy_executor::main] 12#[embassy_executor::main]
13async fn main(_s: embassy_executor::executor::Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner) {
14 let p = embassy_nrf::init(Default::default());
14 let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard); 15 let mut led = Output::new(p.P0_13, Level::Low, OutputDrive::Standard);
15 //let mut led = Output::new(p.P1_10, Level::Low, OutputDrive::Standard); 16 //let mut led = Output::new(p.P1_10, Level::Low, OutputDrive::Standard);
16 17