diff options
author | Dario Nieuwenhuis <dirbaio@dirbaio.net> | 2021-05-10 00:24:24 +0200 |
---|---|---|
committer | Dario Nieuwenhuis <dirbaio@dirbaio.net> | 2021-05-10 00:24:24 +0200 |
commit | 8201255a9d6dde4b29a5a539a1d6aeefcbd467df (patch) | |
tree | 3366939a2c4b121091eb1abb3605f82e750b5c2f /examples/src/bin/ble_bas_central.rs | |
parent | 7e0bf163f35dca8a1daba11429035a7780f5f4b7 (diff) | |
download | nrf-softdevice-8201255a9d6dde4b29a5a539a1d6aeefcbd467df.zip |
Update embassy
Diffstat (limited to 'examples/src/bin/ble_bas_central.rs')
-rw-r--r-- | examples/src/bin/ble_bas_central.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/src/bin/ble_bas_central.rs b/examples/src/bin/ble_bas_central.rs index 5e56d9d..8911ca8 100644 --- a/examples/src/bin/ble_bas_central.rs +++ b/examples/src/bin/ble_bas_central.rs @@ -4,16 +4,16 @@ #![feature(min_type_alias_impl_trait)] #![feature(impl_trait_in_bindings)] #![feature(alloc_error_handler)] +#![allow(incomplete_features)] #[path = "../example_common.rs"] mod example_common; -use example_common::*; use core::mem; use cortex_m_rt::entry; use defmt::info; use defmt::*; -use embassy::executor::{task, Executor}; +use embassy::executor::Executor; use embassy::util::Forever; use nrf_softdevice::ble::{central, gatt_client, Address, AddressType}; @@ -22,7 +22,7 @@ use nrf_softdevice::Softdevice; static EXECUTOR: Forever<Executor> = Forever::new(); -#[task] +#[embassy::task] async fn softdevice_task(sd: &'static Softdevice) { sd.run().await; } @@ -33,7 +33,7 @@ struct BatteryServiceClient { battery_level: u8, } -#[task] +#[embassy::task] async fn ble_central_task(sd: &'static Softdevice) { let addrs = &[&Address::new( AddressType::RandomStatic, @@ -97,8 +97,7 @@ fn main() -> ! { ..Default::default() }; - let (sdp, _p) = take_peripherals(); - let sd = Softdevice::enable(sdp, &config); + let sd = Softdevice::enable(&config); let executor = EXECUTOR.put(Executor::new()); executor.run(|spawner| { |