summaryrefslogtreecommitdiff
path: root/examples/src/bin/ble_scan.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/src/bin/ble_scan.rs')
-rw-r--r--examples/src/bin/ble_scan.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/examples/src/bin/ble_scan.rs b/examples/src/bin/ble_scan.rs
index 7250364..c8b71e3 100644
--- a/examples/src/bin/ble_scan.rs
+++ b/examples/src/bin/ble_scan.rs
@@ -109,12 +109,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_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_task(sd)));
+ });
}