Skip to content

Commit 1fa26c9

Browse files
committed
Update to embassy-nrf 0.8
1 parent 3854ab5 commit 1fa26c9

File tree

8 files changed

+44
-62
lines changed

8 files changed

+44
-62
lines changed

examples/nrf/Cargo.lock

Lines changed: 29 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/nrf/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ embassy-sync = { version = "0.7", features = ["defmt"] }
3838
embassy-futures = "0.1"
3939
embassy-time = { version = "0.5", features = ["defmt"] }
4040
embassy-net = { version = "0.7", features = ["defmt", "proto-ipv6", "medium-ip", "udp"] }
41-
embassy-nrf = { version = "0.7", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac", "time"] }
41+
embassy-nrf = { version = "0.8", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac", "time"] }
4242
defmt = "0.3"
4343
heapless = "0.8"
4444
critical-section = "1.1"

examples/nrf/src/bin/basic_enet.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use embassy_net::{Config, ConfigV6, Ipv6Cidr, Runner, StackResources, StaticConf
2222
use embassy_nrf::interrupt;
2323
use embassy_nrf::interrupt::{InterruptExt, Priority};
2424
use embassy_nrf::mode::Blocking;
25-
use embassy_nrf::peripherals::{RADIO, RNG};
2625
use embassy_nrf::rng::Rng;
2726
use embassy_nrf::{bind_interrupts, peripherals, radio};
2827

@@ -89,7 +88,7 @@ async fn main(spawner: Spawner) {
8988

9089
info!("Starting...");
9190

92-
let rng = mk_static!(Rng<'static, RNG, Blocking>, Rng::new_blocking(p.RNG));
91+
let rng = mk_static!(Rng<'static, Blocking>, Rng::new_blocking(p.RNG));
9392

9493
let enet_seed = rng.next_u64();
9594

@@ -223,7 +222,7 @@ async fn run_enet_driver(
223222
}
224223

225224
#[embassy_executor::task]
226-
async fn run_radio(mut runner: PhyRadioRunner<'static>, radio: NrfRadio<'static, RADIO>) -> ! {
225+
async fn run_radio(mut runner: PhyRadioRunner<'static>, radio: NrfRadio<'static>) -> ! {
227226
runner
228227
.run(
229228
radio,

examples/nrf/src/bin/basic_udp.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use embassy_executor::Spawner;
1818
use embassy_nrf::interrupt;
1919
use embassy_nrf::interrupt::{InterruptExt, Priority};
2020
use embassy_nrf::mode::Blocking;
21-
use embassy_nrf::peripherals::{RADIO, RNG};
2221
use embassy_nrf::rng::Rng;
2322
use embassy_nrf::{bind_interrupts, peripherals, radio};
2423

@@ -82,7 +81,7 @@ async fn main(spawner: Spawner) {
8281

8382
info!("Starting...");
8483

85-
let rng = mk_static!(Rng<'static, RNG, Blocking>, Rng::new_blocking(p.RNG));
84+
let rng = mk_static!(Rng<'static, Blocking>, Rng::new_blocking(p.RNG));
8685

8786
let mut ieee_eui64 = [0; 8];
8887
RngCore::fill_bytes(rng, &mut ieee_eui64);
@@ -155,7 +154,7 @@ async fn run_ot(ot: OpenThread<'static>, radio: ProxyRadio<'static>) -> ! {
155154
}
156155

157156
#[embassy_executor::task]
158-
async fn run_radio(mut runner: PhyRadioRunner<'static>, radio: NrfRadio<'static, RADIO>) -> ! {
157+
async fn run_radio(mut runner: PhyRadioRunner<'static>, radio: NrfRadio<'static>) -> ! {
159158
runner
160159
.run(
161160
radio,

examples/nrf/src/bin/srp.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use embassy_executor::Spawner;
2222
use embassy_nrf::interrupt;
2323
use embassy_nrf::interrupt::{InterruptExt, Priority};
2424
use embassy_nrf::mode::Blocking;
25-
use embassy_nrf::peripherals::{RADIO, RNG};
2625
use embassy_nrf::rng::Rng;
2726
use embassy_nrf::{bind_interrupts, peripherals, radio};
2827

@@ -89,7 +88,7 @@ async fn main(spawner: Spawner) {
8988

9089
info!("Starting...");
9190

92-
let rng = mk_static!(Rng<'static, RNG, Blocking>, Rng::new_blocking(p.RNG));
91+
let rng = mk_static!(Rng<'static, Blocking>, Rng::new_blocking(p.RNG));
9392

9493
let mut ieee_eui64 = [0; 8];
9594
RngCore::fill_bytes(rng, &mut ieee_eui64);
@@ -208,7 +207,7 @@ async fn run_ot(ot: OpenThread<'static>, radio: ProxyRadio<'static>) -> ! {
208207
}
209208

210209
#[embassy_executor::task]
211-
async fn run_radio(mut runner: PhyRadioRunner<'static>, radio: NrfRadio<'static, RADIO>) -> ! {
210+
async fn run_radio(mut runner: PhyRadioRunner<'static>, radio: NrfRadio<'static>) -> ! {
212211
runner
213212
.run(
214213
radio,

openthread/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

openthread/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ bitflags = "2.5"
4141
embassy-net-driver-channel = { version = "0.3", optional = true }
4242
edge-nal = { version = "0.5", optional = true }
4343
esp-radio = { version = "0.15", features = ["unstable", "ieee802154"], optional = true }
44-
embassy-nrf = { version = "0.7", optional = true }
44+
embassy-nrf = { version = "0.8", optional = true }
4545
portable-atomic = "1"

openthread/src/nrf.rs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,16 @@ impl RadioError for Error {
1818
}
1919

2020
/// The `embassy-nrf` ESP IEEE 802.15.4 radio.
21-
pub struct NrfRadio<'a, T>
22-
where
23-
T: Ieee802154Peripheral,
24-
{
25-
driver: Ieee802154<'a, T>,
21+
pub struct NrfRadio<'a> {
22+
driver: Ieee802154<'a>,
2623
config: Config,
2724
}
2825

29-
impl<'a, T> NrfRadio<'a, T>
30-
where
31-
T: Ieee802154Peripheral,
32-
{
26+
impl<'a> NrfRadio<'a> {
3327
const DEFAULT_CONFIG: Config = Config::new();
3428

3529
/// Create a new `EspRadio` instance.
36-
pub fn new(radio: Ieee802154<'a, T>) -> Self {
30+
pub fn new(radio: Ieee802154<'a>) -> Self {
3731
let mut this = Self {
3832
driver: radio,
3933
config: Self::DEFAULT_CONFIG,
@@ -58,10 +52,7 @@ where
5852
}
5953
}
6054

61-
impl<T> Radio for NrfRadio<'_, T>
62-
where
63-
T: Ieee802154Peripheral,
64-
{
55+
impl Radio for NrfRadio<'_> {
6556
type Error = Error;
6657

6758
fn caps(&mut self) -> Capabilities {

0 commit comments

Comments
 (0)