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_peripheral.rs | |
parent | 7e0bf163f35dca8a1daba11429035a7780f5f4b7 (diff) | |
download | nrf-softdevice-8201255a9d6dde4b29a5a539a1d6aeefcbd467df.zip |
Update embassy
Diffstat (limited to 'examples/src/bin/ble_bas_peripheral.rs')
-rw-r--r-- | examples/src/bin/ble_bas_peripheral.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/examples/src/bin/ble_bas_peripheral.rs b/examples/src/bin/ble_bas_peripheral.rs index e2a7846..949a5cc 100644 --- a/examples/src/bin/ble_bas_peripheral.rs +++ b/examples/src/bin/ble_bas_peripheral.rs @@ -4,24 +4,24 @@ #![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::Executor; +use embassy::util::Forever; use nrf_softdevice::ble::{gatt_server, peripheral}; use nrf_softdevice::{raw, Softdevice}; -use embassy::executor::{task, Executor}; -use embassy::util::Forever; static EXECUTOR: Forever<Executor> = Forever::new(); -#[task] +#[embassy::task] async fn softdevice_task(sd: &'static Softdevice) { sd.run().await; } @@ -34,7 +34,7 @@ struct BatteryService { foo: u16, } -#[task] +#[embassy::task] async fn bluetooth_task(sd: &'static Softdevice) { let server: BatteryService = unwrap!(gatt_server::register(sd)); #[rustfmt::skip] @@ -127,8 +127,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| { |