diff options
author | Dario Nieuwenhuis <dirbaio@dirbaio.net> | 2021-02-03 06:44:20 +0100 |
---|---|---|
committer | Dario Nieuwenhuis <dirbaio@dirbaio.net> | 2021-02-03 06:44:20 +0100 |
commit | 9400ecccb5271e03a46a07825b2775bc3bf7f609 (patch) | |
tree | 0ab12661720efd27ebf71ce23b9ee17e9c6a4f72 /examples/src/bin/ble_bas_peripheral.rs | |
parent | 96e625fc3baa4f258e9e9f761845a76751710b0d (diff) | |
download | nrf-softdevice-9400ecccb5271e03a46a07825b2775bc3bf7f609.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, 5 insertions, 8 deletions
diff --git a/examples/src/bin/ble_bas_peripheral.rs b/examples/src/bin/ble_bas_peripheral.rs index 53b4e34..7d754b0 100644 --- a/examples/src/bin/ble_bas_peripheral.rs +++ b/examples/src/bin/ble_bas_peripheral.rs @@ -128,12 +128,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, peripheral::Config::default()))); + }); } |