summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralexmoon <alex.r.moon@gmail.com>2022-08-03 19:57:00 -0600
committerGitHub <noreply@github.com>2022-08-03 19:57:00 -0600
commitab0ad770c729b4f034bf0a085b50347a3e6b2ea9 (patch)
treede4346b0a4292773a0aff19256d6e11c69045056
parent068536b616ef3790d8758b164f2fc3803c89fc26 (diff)
parentefa5e46b917bf750665a12711bd0e8f18c412cab (diff)
downloadnrf-softdevice-ab0ad770c729b4f034bf0a085b50347a3e6b2ea9.zip
Merge pull request #128 from embassy-rs/update-embassy
Update Embassy (for the executor/util crate split)
-rw-r--r--Cargo.lock154
-rw-r--r--Cargo.toml7
-rw-r--r--README.md2
-rw-r--r--examples/Cargo.toml3
-rw-r--r--examples/src/bin/ble_advertise.rs8
-rw-r--r--examples/src/bin/ble_bas_central.rs8
-rw-r--r--examples/src/bin/ble_bas_peripheral.rs8
-rw-r--r--examples/src/bin/ble_dis_bas_peripheral_builder.rs8
-rw-r--r--examples/src/bin/ble_l2cap_central.rs8
-rw-r--r--examples/src/bin/ble_l2cap_peripheral.rs8
-rw-r--r--examples/src/bin/ble_peripheral_onoff.rs8
-rw-r--r--examples/src/bin/ble_scan.rs8
-rw-r--r--examples/src/bin/flash.rs8
-rw-r--r--nrf-softdevice/Cargo.toml2
-rw-r--r--nrf-softdevice/src/events.rs2
-rw-r--r--nrf-softdevice/src/softdevice.rs2
16 files changed, 124 insertions, 120 deletions
diff --git a/Cargo.lock b/Cargo.lock
index ebfcb7a..14cf2f1 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -29,7 +29,7 @@ checksum = "45403b49e3954a4b8428a0ac21a4b7afadccf92bfd96273f1a58cd4812496ae0"
dependencies = [
"generic-array 0.12.4",
"generic-array 0.13.3",
- "generic-array 0.14.5",
+ "generic-array 0.14.6",
"stable_deref_trait",
]
@@ -53,9 +53,9 @@ dependencies = [
[[package]]
name = "atomic-pool"
-version = "0.2.2"
+version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b407ed6d721feca5f9432fcd24dec6857debbc8f5d86a75538d871ee85b8b1f"
+checksum = "fc4465bd860f25ccaa7bc3779eaa671fd1d84ad51e6d343965e3ea73007045bd"
dependencies = [
"as-slice 0.1.5",
"as-slice 0.2.1",
@@ -71,9 +71,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "az"
-version = "1.2.0"
+version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f771a5d1f5503f7f4279a30f3643d3421ba149848b89ecaaec0ea2acf04a5ac4"
+checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973"
[[package]]
name = "bare-metal"
@@ -110,9 +110,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bytemuck"
-version = "1.10.0"
+version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c53dfa917ec274df8ed3c572698f381a24eef2efba9492d797301b72b6db408a"
+checksum = "a5377c8865e74a160d21f29c2d40669f53286db6eab59b88540cbb12ffc8b835"
[[package]]
name = "byteorder"
@@ -171,6 +171,12 @@ dependencies = [
]
[[package]]
+name = "crunchy"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
+
+[[package]]
name = "darling"
version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -280,43 +286,27 @@ dependencies = [
]
[[package]]
-name = "embassy"
-version = "0.1.0"
-source = "git+https://github.com/embassy-rs/embassy#5318fe404bed68a38a1d81eb7359ebc38e6fad15"
-dependencies = [
- "atomic-polyfill",
- "cfg-if",
- "cortex-m",
- "critical-section",
- "defmt",
- "embassy-macros",
- "embedded-hal 0.2.7",
- "embedded-hal-async",
- "futures",
- "heapless",
- "pin-project",
-]
-
-[[package]]
name = "embassy-cortex-m"
version = "0.1.0"
-source = "git+https://github.com/embassy-rs/embassy#5318fe404bed68a38a1d81eb7359ebc38e6fad15"
+source = "git+https://github.com/embassy-rs/embassy?rev=1924f2d67d32a4466e71ef0aabc84305a9e8e165#1924f2d67d32a4466e71ef0aabc84305a9e8e165"
dependencies = [
"atomic-polyfill",
"cfg-if",
"cortex-m",
"critical-section",
- "embassy",
+ "embassy-executor",
"embassy-hal-common",
"embassy-macros",
+ "embassy-util",
]
[[package]]
name = "embassy-embedded-hal"
version = "0.1.0"
-source = "git+https://github.com/embassy-rs/embassy#5318fe404bed68a38a1d81eb7359ebc38e6fad15"
+source = "git+https://github.com/embassy-rs/embassy?rev=1924f2d67d32a4466e71ef0aabc84305a9e8e165#1924f2d67d32a4466e71ef0aabc84305a9e8e165"
dependencies = [
- "embassy",
+ "defmt",
+ "embassy-util",
"embedded-hal 0.2.7",
"embedded-hal 1.0.0-alpha.8",
"embedded-hal-async",
@@ -326,19 +316,33 @@ dependencies = [
]
[[package]]
+name = "embassy-executor"
+version = "0.1.0"
+source = "git+https://github.com/embassy-rs/embassy?rev=1924f2d67d32a4466e71ef0aabc84305a9e8e165#1924f2d67d32a4466e71ef0aabc84305a9e8e165"
+dependencies = [
+ "atomic-polyfill",
+ "cfg-if",
+ "critical-section",
+ "defmt",
+ "embassy-macros",
+ "embedded-hal 0.2.7",
+ "embedded-hal-async",
+ "futures-util",
+]
+
+[[package]]
name = "embassy-hal-common"
version = "0.1.0"
-source = "git+https://github.com/embassy-rs/embassy#5318fe404bed68a38a1d81eb7359ebc38e6fad15"
+source = "git+https://github.com/embassy-rs/embassy?rev=1924f2d67d32a4466e71ef0aabc84305a9e8e165#1924f2d67d32a4466e71ef0aabc84305a9e8e165"
dependencies = [
- "cortex-m",
- "embassy",
+ "embassy-util",
"num-traits",
]
[[package]]
name = "embassy-macros"
version = "0.1.0"
-source = "git+https://github.com/embassy-rs/embassy#5318fe404bed68a38a1d81eb7359ebc38e6fad15"
+source = "git+https://github.com/embassy-rs/embassy?rev=1924f2d67d32a4466e71ef0aabc84305a9e8e165#1924f2d67d32a4466e71ef0aabc84305a9e8e165"
dependencies = [
"darling 0.13.4",
"proc-macro2",
@@ -349,19 +353,20 @@ dependencies = [
[[package]]
name = "embassy-nrf"
version = "0.1.0"
-source = "git+https://github.com/embassy-rs/embassy#5318fe404bed68a38a1d81eb7359ebc38e6fad15"
+source = "git+https://github.com/embassy-rs/embassy?rev=1924f2d67d32a4466e71ef0aabc84305a9e8e165#1924f2d67d32a4466e71ef0aabc84305a9e8e165"
dependencies = [
"cfg-if",
"cortex-m",
"cortex-m-rt",
"critical-section",
"defmt",
- "embassy",
"embassy-cortex-m",
"embassy-embedded-hal",
+ "embassy-executor",
"embassy-hal-common",
"embassy-macros",
"embassy-usb",
+ "embassy-util",
"embedded-hal 0.2.7",
"embedded-hal 1.0.0-alpha.8",
"embedded-hal-async",
@@ -377,10 +382,23 @@ dependencies = [
[[package]]
name = "embassy-usb"
version = "0.1.0"
-source = "git+https://github.com/embassy-rs/embassy#5318fe404bed68a38a1d81eb7359ebc38e6fad15"
+source = "git+https://github.com/embassy-rs/embassy?rev=1924f2d67d32a4466e71ef0aabc84305a9e8e165#1924f2d67d32a4466e71ef0aabc84305a9e8e165"
+dependencies = [
+ "defmt",
+ "embassy-util",
+ "heapless",
+]
+
+[[package]]
+name = "embassy-util"
+version = "0.1.0"
+source = "git+https://github.com/embassy-rs/embassy?rev=1924f2d67d32a4466e71ef0aabc84305a9e8e165#1924f2d67d32a4466e71ef0aabc84305a9e8e165"
dependencies = [
+ "atomic-polyfill",
+ "cfg-if",
+ "critical-section",
"defmt",
- "embassy",
+ "futures-util",
"heapless",
]
@@ -438,9 +456,9 @@ dependencies = [
[[package]]
name = "fixed"
-version = "1.16.0"
+version = "1.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93db1ca4ef0496cc54f43660fcb423bc16ced939b8fdd9749e7abcd5674f1803"
+checksum = "6ff8fc11090cf4e92c9f9052e778d3dc869d0fb943cdc5568df3d3b559a58787"
dependencies = [
"az",
"bytemuck",
@@ -535,9 +553,9 @@ dependencies = [
[[package]]
name = "generic-array"
-version = "0.14.5"
+version = "0.14.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803"
+checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9"
dependencies = [
"typenum",
"version_check",
@@ -545,9 +563,12 @@ dependencies = [
[[package]]
name = "half"
-version = "1.8.2"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7"
+checksum = "ad6a9459c9c30b177b925162351f97e7d967c7ea8bab3b8352805327daf45554"
+dependencies = [
+ "crunchy",
+]
[[package]]
name = "hash32"
@@ -631,7 +652,7 @@ dependencies = [
"cortex-m-rt",
"critical-section",
"defmt",
- "embassy",
+ "embassy-util",
"embedded-storage",
"embedded-storage-async",
"fixed",
@@ -663,8 +684,9 @@ dependencies = [
"cortex-m-rt",
"defmt",
"defmt-rtt",
- "embassy",
+ "embassy-executor",
"embassy-nrf",
+ "embassy-util",
"embedded-storage",
"embedded-storage-async",
"fixed",
@@ -828,26 +850,6 @@ dependencies = [
]
[[package]]
-name = "pin-project"
-version = "1.0.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78203e83c48cffbe01e4a2d35d566ca4de445d79a85372fc64e378bfc812a260"
-dependencies = [
- "pin-project-internal",
-]
-
-[[package]]
-name = "pin-project-internal"
-version = "1.0.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "710faf75e1b33345361201d36d04e98ac1ed8909151a017ed384700836104c74"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
name = "pin-project-lite"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -885,18 +887,18 @@ dependencies = [
[[package]]
name = "proc-macro2"
-version = "1.0.40"
+version = "1.0.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7"
+checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
-version = "1.0.20"
+version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804"
+checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179"
dependencies = [
"proc-macro2",
]
@@ -960,7 +962,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
dependencies = [
- "semver 1.0.12",
+ "semver 1.0.13",
]
[[package]]
@@ -980,9 +982,9 @@ dependencies = [
[[package]]
name = "semver"
-version = "1.0.12"
+version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1"
+checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711"
[[package]]
name = "semver-parser"
@@ -1019,9 +1021,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]]
name = "syn"
-version = "1.0.98"
+version = "1.0.99"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd"
+checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13"
dependencies = [
"proc-macro2",
"quote",
@@ -1036,9 +1038,9 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987"
[[package]]
name = "unicode-ident"
-version = "1.0.1"
+version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c"
+checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf"
[[package]]
name = "uuid"
diff --git a/Cargo.toml b/Cargo.toml
index 6a90ca9..fb75ed1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,9 +18,10 @@ exclude = [
]
[patch.crates-io]
-embassy = { git = "https://github.com/embassy-rs/embassy" }
-embassy-nrf = { git = "https://github.com/embassy-rs/embassy" }
-embassy-macros = { git = "https://github.com/embassy-rs/embassy" }
+embassy-executor = { git = "https://github.com/embassy-rs/embassy", rev = "1924f2d67d32a4466e71ef0aabc84305a9e8e165" }
+embassy-util = { git = "https://github.com/embassy-rs/embassy", rev = "1924f2d67d32a4466e71ef0aabc84305a9e8e165" }
+embassy-nrf = { git = "https://github.com/embassy-rs/embassy", rev = "1924f2d67d32a4466e71ef0aabc84305a9e8e165" }
+embassy-macros = { git = "https://github.com/embassy-rs/embassy", rev = "1924f2d67d32a4466e71ef0aabc84305a9e8e165" }
[profile.release]
codegen-units = 1
diff --git a/README.md b/README.md
index 84e2765..13fd43c 100644
--- a/README.md
+++ b/README.md
@@ -137,7 +137,7 @@ DO NOT disable the softdevice's interrupts. You MUST NOT use the widely-used `co
- Make sure the `critical-section-impl` Cargo feature is enabled for `nrf-softdevice`. This makes `nrf-softdevice` emit a custom critical section implementation that disables only non-softdevice interrupts.
- Use `critical_section::with` instead of `cortex_m::interrupt::free`. This uses the custom critical-section impl.
-- Use `embassy::blocking_mutex::CriticalSectionMutex` instead of `cortex_m::interrupt::Mutex`.
+- Use `embassy_util::blocking_mutex::CriticalSectionMutex` instead of `cortex_m::interrupt::Mutex`.
Make sure you're not using any library that internally uses `cortex_m::interrupt::free` as well.
diff --git a/examples/Cargo.toml b/examples/Cargo.toml
index 468547f..ee34c58 100644
--- a/examples/Cargo.toml
+++ b/examples/Cargo.toml
@@ -16,7 +16,8 @@ ble-gatt-server = ["nrf-softdevice/ble-gatt-server"]
ble-gatt-client = ["nrf-softdevice/ble-gatt-client"]
[dependencies]
-embassy = { version = "0.1.0", features = ["nightly", "defmt", "defmt-timestamp-uptime"]}
+embassy-executor = { version = "0.1.0", features = ["nightly", "defmt", "defmt-timestamp-uptime"]}
+embassy-util = { version = "0.1.0" }
embassy-nrf = { version = "0.1.0", features = [ "nightly", "defmt", "nrf52840", "gpiote", "time-driver-rtc1" ]}
cortex-m = "0.7.2"
cortex-m-rt = "0.7.0"
diff --git a/examples/src/bin/ble_advertise.rs b/examples/src/bin/ble_advertise.rs
index b6f7bd4..31804b3 100644
--- a/examples/src/bin/ble_advertise.rs
+++ b/examples/src/bin/ble_advertise.rs
@@ -9,19 +9,19 @@ use core::mem;
use cortex_m_rt::entry;
use defmt::{info, unreachable, *};
-use embassy::executor::Executor;
-use embassy::util::Forever;
+use embassy_executor::executor::Executor;
+use embassy_util::Forever;
use nrf_softdevice::ble::peripheral;
use nrf_softdevice::{raw, Softdevice};
static EXECUTOR: Forever<Executor> = Forever::new();
-#[embassy::task]
+#[embassy_executor::task]
async fn softdevice_task(sd: &'static Softdevice) {
sd.run().await;
}
-#[embassy::task]
+#[embassy_executor::task]
async fn bluetooth_task(sd: &'static Softdevice) {
#[rustfmt::skip]
let adv_data = &[
diff --git a/examples/src/bin/ble_bas_central.rs b/examples/src/bin/ble_bas_central.rs
index f0bda6e..3594f55 100644
--- a/examples/src/bin/ble_bas_central.rs
+++ b/examples/src/bin/ble_bas_central.rs
@@ -9,14 +9,14 @@ use core::mem;
use cortex_m_rt::entry;
use defmt::{info, *};
-use embassy::executor::Executor;
-use embassy::util::Forever;
+use embassy_executor::executor::Executor;
+use embassy_util::Forever;
use nrf_softdevice::ble::{central, gatt_client, Address, AddressType};
use nrf_softdevice::{raw, Softdevice};
static EXECUTOR: Forever<Executor> = Forever::new();
-#[embassy::task]
+#[embassy_executor::task]
async fn softdevice_task(sd: &'static Softdevice) {
sd.run().await;
}
@@ -27,7 +27,7 @@ struct BatteryServiceClient {
battery_level: u8,
}
-#[embassy::task]
+#[embassy_executor::task]
async fn ble_central_task(sd: &'static Softdevice) {
let addrs = &[&Address::new(
AddressType::RandomStatic,
diff --git a/examples/src/bin/ble_bas_peripheral.rs b/examples/src/bin/ble_bas_peripheral.rs
index d62a111..03fc603 100644
--- a/examples/src/bin/ble_bas_peripheral.rs
+++ b/examples/src/bin/ble_bas_peripheral.rs
@@ -9,14 +9,14 @@ use core::mem;
use cortex_m_rt::entry;
use defmt::{info, *};
-use embassy::executor::Executor;
-use embassy::util::Forever;
+use embassy_executor::executor::Executor;
+use embassy_util::Forever;
use nrf_softdevice::ble::{gatt_server, peripheral};
use nrf_softdevice::{raw, Softdevice};
static EXECUTOR: Forever<Executor> = Forever::new();
-#[embassy::task]
+#[embassy_executor::task]
async fn softdevice_task(sd: &'static Softdevice) {
sd.run().await;
}
@@ -39,7 +39,7 @@ struct Server {
foo: FooService,
}
-#[embassy::task]
+#[embassy_executor::task]
async fn bluetooth_task(sd: &'static Softdevice, server: Server) {
#[rustfmt::skip]
let adv_data = &[
diff --git a/examples/src/bin/ble_dis_bas_peripheral_builder.rs b/examples/src/bin/ble_dis_bas_peripheral_builder.rs
index 4d65e67..71ae849 100644
--- a/examples/src/bin/ble_dis_bas_peripheral_builder.rs
+++ b/examples/src/bin/ble_dis_bas_peripheral_builder.rs
@@ -9,8 +9,8 @@ use core::mem;
use cortex_m_rt::entry;
use defmt::{info, *};
-use embassy::executor::Executor;
-use embassy::util::Forever;
+use embassy_executor::executor::Executor;
+use embassy_util::Forever;
use nrf_softdevice::ble::gatt_server::builder::ServiceBuilder;
use nrf_softdevice::ble::gatt_server::characteristic::{Attribute, Metadata, Properties};
use nrf_softdevice::ble::gatt_server::{CharacteristicHandles, RegisterError};
@@ -31,7 +31,7 @@ const PNP_ID: Uuid = Uuid::new_16(0x2a50);
static EXECUTOR: Forever<Executor> = Forever::new();
-#[embassy::task]
+#[embassy_executor::task]
async fn softdevice_task(sd: &'static Softdevice) {
sd.run().await;
}
@@ -186,7 +186,7 @@ impl gatt_server::Server for Server {
}
}
-#[embassy::task]
+#[embassy_executor::task]
async fn bluetooth_task(sd: &'static Softdevice, server: Server) {
#[rustfmt::skip]
let adv_data = &[
diff --git a/examples/src/bin/ble_l2cap_central.rs b/examples/src/bin/ble_l2cap_central.rs
index f344fa8..9b2cb5a 100644
--- a/examples/src/bin/ble_l2cap_central.rs
+++ b/examples/src/bin/ble_l2cap_central.rs
@@ -10,8 +10,8 @@ use core::{mem, slice};
use cortex_m_rt::entry;
use defmt::{info, *};
-use embassy::executor::Executor;
-use embassy::util::Forever;
+use embassy_executor::executor::Executor;
+use embassy_util::Forever;
use nrf_softdevice::ble::l2cap::Packet as _;
use nrf_softdevice::ble::{central, l2cap, Address, TxPower};
use nrf_softdevice::{raw, Softdevice};
@@ -20,12 +20,12 @@ static EXECUTOR: Forever<Executor> = Forever::new();
const PSM: u16 = 0x2349;
-#[embassy::task]
+#[embassy_executor::task]
async fn softdevice_task(sd: &'static Softdevice) {
sd.run().await;
}
-#[embassy::task]
+#[embassy_executor::task]
async fn ble_central_task(sd: &'static Softdevice) {
info!("Scanning for peer...");
diff --git a/examples/src/bin/ble_l2cap_peripheral.rs b/examples/src/bin/ble_l2cap_peripheral.rs
index d542a45..3e72725 100644
--- a/examples/src/bin/ble_l2cap_peripheral.rs
+++ b/examples/src/bin/ble_l2cap_peripheral.rs
@@ -10,8 +10,8 @@ use core::ptr::NonNull;
use cortex_m_rt::entry;
use defmt::*;
-use embassy::executor::Executor;
-use embassy::util::Forever;
+use embassy_executor::executor::Executor;
+use embassy_util::Forever;
use nrf_softdevice::ble::{l2cap, peripheral};
use nrf_softdevice::{ble, raw, RawError, Softdevice};
@@ -19,12 +19,12 @@ static EXECUTOR: Forever<Executor> = Forever::new();
const PSM: u16 = 0x2349;
-#[embassy::task]
+#[embassy_executor::task]
async fn softdevice_task(sd: &'static Softdevice) {
sd.run().await;
}
-#[embassy::task]
+#[embassy_executor::task]
async fn bluetooth_task(sd: &'static Softdevice) {
info!("My address: {:?}", ble::get_address(sd));
diff --git a/examples/src/bin/ble_peripheral_onoff.rs b/examples/src/bin/ble_peripheral_onoff.rs
index a75ec49..99dcac4 100644
--- a/examples/src/bin/ble_peripheral_onoff.rs
+++ b/examples/src/bin/ble_peripheral_onoff.rs
@@ -9,17 +9,17 @@ use core::mem;
use cortex_m_rt::entry;
use defmt::*;
-use embassy::executor::Executor;
-use embassy::util::Forever;
+use embassy_executor::executor::Executor;
use embassy_nrf::gpio::{AnyPin, Input, Pin as _, Pull};
use embassy_nrf::interrupt::Priority;
+use embassy_util::Forever;
use futures::pin_mut;
use nrf_softdevice::ble::{gatt_server, peripheral};
use nrf_softdevice::{raw, Softdevice};
static EXECUTOR: Forever<Executor> = Forever::new();
-#[embassy::task]
+#[embassy_executor::task]
async fn softdevice_task(sd: &'static Softdevice) {
sd.run().await;
}
@@ -73,7 +73,7 @@ async fn run_bluetooth(sd: &'static Softdevice, server: &Server) {
}
}
-#[embassy::task]
+#[embassy_executor::task]
async fn bluetooth_task(sd: &'static Softdevice, server: Server, button1: AnyPin, button2: AnyPin) {
info!("Bluetooth is OFF");
info!("Press nrf52840-dk button 1 to enable, button 2 to disable");
diff --git a/examples/src/bin/ble_scan.rs b/examples/src/bin/ble_scan.rs
index c8ed543..7c33c31 100644
--- a/examples/src/bin/ble_scan.rs
+++ b/examples/src/bin/ble_scan.rs
@@ -9,19 +9,19 @@ use core::{mem, slice};
use cortex_m_rt::entry;
use defmt::*;
-use embassy::executor::Executor;
-use embassy::util::Forever;
+use embassy_executor::executor::Executor;
+use embassy_util::Forever;
use nrf_softdevice::ble::central;
use nrf_softdevice::{raw, Softdevice};
static EXECUTOR: Forever<Executor> = Forever::new();
-#[embassy::task]
+#[embassy_executor::task]
async fn softdevice_task(sd: &'static Softdevice) {
sd.run().await;
}
-#[embassy::task]
+#[embassy_executor::task]
async fn ble_task(sd: &'static Softdevice) {
let config = central::ScanConfig::default();
let res = central::scan(sd, &config, |params| unsafe {
diff --git a/examples/src/bin/flash.rs b/examples/src/bin/flash.rs
index dfaa7fb..78cb42d 100644
--- a/examples/src/bin/flash.rs
+++ b/examples/src/bin/flash.rs
@@ -7,20 +7,20 @@ mod example_common;
use cortex_m_rt::entry;
use defmt::*;
-use embassy::executor::Executor;
-use embassy::util::Forever;
+use embassy_executor::executor::Executor;
+use embassy_util::Forever;
use embedded_storage_async::nor_flash::*;
use futures::pin_mut;
use nrf_softdevice::{Flash, Softdevice};
static EXECUTOR: Forever<Executor> = Forever::new();
-#[embassy::task]
+#[embassy_executor::task]
async fn softdevice_task(sd: &'static Softdevice) {
sd.run().await;
}
-#[embassy::task]
+#[embassy_executor::task]
async fn flash_task(sd: &'static Softdevice) {
let f = Flash::take(sd);
pin_mut!(f);
diff --git a/nrf-softdevice/Cargo.toml b/nrf-softdevice/Cargo.toml
index 9b7df74..2d0b211 100644
--- a/nrf-softdevice/Cargo.toml
+++ b/nrf-softdevice/Cargo.toml
@@ -41,7 +41,7 @@ log = { version = "0.4.11", optional = true }
critical-section = { version = "0.2.1" }
num_enum = { version = "0.5.1", default-features = false }
-embassy = { version = "0.1.0" }
+embassy-util = { version = "0.1.0" }
cortex-m = "0.7.2"
cortex-m-rt = ">=0.6.15,<0.8"
heapless = "0.7.1"
diff --git a/nrf-softdevice/src/events.rs b/nrf-softdevice/src/events.rs
index dd60c64..794f3df 100644
--- a/nrf-softdevice/src/events.rs
+++ b/nrf-softdevice/src/events.rs
@@ -1,7 +1,7 @@
use core::mem::MaybeUninit;
use core::task::Poll;
-use embassy::waitqueue::AtomicWaker;
+use embassy_util::waitqueue::AtomicWaker;
use futures::future::poll_fn;
use num_enum::{IntoPrimitive, TryFromPrimitive};
diff --git a/nrf-softdevice/src/softdevice.rs b/nrf-softdevice/src/softdevice.rs
index 84248e8..caad633 100644
--- a/nrf-softdevice/src/softdevice.rs
+++ b/nrf-softdevice/src/softdevice.rs
@@ -2,7 +2,7 @@ use core::marker::PhantomData;
use core::ptr;
use core::sync::atomic::{AtomicBool, Ordering};
-use embassy::util::Forever;
+use embassy_util::Forever;
use crate::{pac, raw, RawError, SocEvent};