summaryrefslogtreecommitdiff
path: root/examples/src/bin/ble_l2cap_peripheral.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <dirbaio@dirbaio.net>2021-02-03 06:44:20 +0100
committerDario Nieuwenhuis <dirbaio@dirbaio.net>2021-02-03 06:44:20 +0100
commit9400ecccb5271e03a46a07825b2775bc3bf7f609 (patch)
tree0ab12661720efd27ebf71ce23b9ee17e9c6a4f72 /examples/src/bin/ble_l2cap_peripheral.rs
parent96e625fc3baa4f258e9e9f761845a76751710b0d (diff)
downloadnrf-softdevice-9400ecccb5271e03a46a07825b2775bc3bf7f609.zip
update embassy
Diffstat (limited to 'examples/src/bin/ble_l2cap_peripheral.rs')
-rw-r--r--examples/src/bin/ble_l2cap_peripheral.rs16
1 files changed, 6 insertions, 10 deletions
diff --git a/examples/src/bin/ble_l2cap_peripheral.rs b/examples/src/bin/ble_l2cap_peripheral.rs
index bc20437..54716af 100644
--- a/examples/src/bin/ble_l2cap_peripheral.rs
+++ b/examples/src/bin/ble_l2cap_peripheral.rs
@@ -12,7 +12,6 @@ use core::mem;
use core::ptr::NonNull;
use cortex_m_rt::entry;
use defmt::{panic, *};
-use heapless::consts::*;
use nrf_softdevice::ble;
use nrf_softdevice::ble::{l2cap, peripheral, Connection};
@@ -30,7 +29,7 @@ async fn softdevice_task(sd: &'static Softdevice) {
}
#[task]
-async fn bluetooth_task(sd: &'static Softdevice, config: peripheral::Config) {
+async fn bluetooth_task(sd: &'static Softdevice) {
info!("My address: {:?}", ble::get_address(sd));
#[rustfmt::skip]
@@ -151,12 +150,9 @@ fn main() -> ! {
let (sdp, p) = take_peripherals();
let sd = Softdevice::enable(sdp, &config);
- let executor = EXECUTOR.put(Executor::new(cortex_m::asm::sev));
- unwrap!(executor.spawn(softdevice_task(sd)));
- unwrap!(executor.spawn(bluetooth_task(sd, peripheral::Config::default())));
-
- loop {
- executor.run();
- cortex_m::asm::wfe();
- }
+ let executor = EXECUTOR.put(Executor::new());
+ executor.run(|spawner| {
+ unwrap!(spawner.spawn(softdevice_task(sd)));
+ unwrap!(spawner.spawn(bluetooth_task(sd)));
+ });
}