summaryrefslogtreecommitdiff
path: root/examples/src/bin/ble_bas_central.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_bas_central.rs
parent96e625fc3baa4f258e9e9f761845a76751710b0d (diff)
downloadnrf-softdevice-9400ecccb5271e03a46a07825b2775bc3bf7f609.zip
update embassy
Diffstat (limited to 'examples/src/bin/ble_bas_central.rs')
-rw-r--r--examples/src/bin/ble_bas_central.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/examples/src/bin/ble_bas_central.rs b/examples/src/bin/ble_bas_central.rs
index be90a4c..eabc539 100644
--- a/examples/src/bin/ble_bas_central.rs
+++ b/examples/src/bin/ble_bas_central.rs
@@ -98,12 +98,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(ble_central_task(sd)));
-
- 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(ble_central_task(sd)));
+ });
}