From 428b9e9e1fe2c8e167e4d83151142690dc44d9c7 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Tue, 15 Mar 2022 22:10:21 +0100 Subject: Change `run()` to never return. --- nrf-softdevice/src/events.rs | 6 +++--- nrf-softdevice/src/softdevice.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'nrf-softdevice') diff --git a/nrf-softdevice/src/events.rs b/nrf-softdevice/src/events.rs index bae549d..bf7c5d6 100644 --- a/nrf-softdevice/src/events.rs +++ b/nrf-softdevice/src/events.rs @@ -50,7 +50,7 @@ fn on_soc_evt(evt: u32) { // TODO actually derive this from the headers + the ATT_MTU const BLE_EVT_MAX_SIZE: u16 = 128; -pub(crate) async fn run() { +pub(crate) async fn run() -> ! { poll_fn(|cx| unsafe { SWI2_WAKER.register(cx.waker()); @@ -78,9 +78,9 @@ pub(crate) async fn run() { } } - Poll::<()>::Pending + Poll::Pending }) - .await; + .await } #[cfg(any(feature = "nrf52805", feature = "nrf52810", feature = "nrf52811"))] diff --git a/nrf-softdevice/src/softdevice.rs b/nrf-softdevice/src/softdevice.rs index a306554..cbcfe8b 100644 --- a/nrf-softdevice/src/softdevice.rs +++ b/nrf-softdevice/src/softdevice.rs @@ -319,7 +319,7 @@ impl Softdevice { /// /// It must be called in its own async task after enabling the softdevice /// and before doing any operation. Failure to doing so will cause async operations to never finish. - pub async fn run(&self) { - crate::events::run().await; + pub async fn run(&self) -> ! { + crate::events::run().await } } -- cgit v1.2.3