From 54e2e17520e678eb5f57661222670f7d891f1810 Mon Sep 17 00:00:00 2001 From: Dániel Buga Date: Sat, 26 Aug 2023 05:43:16 +0200 Subject: Avoid dead code warning --- embassy-executor/src/arch/cortex_m.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'embassy-executor/src/arch') diff --git a/embassy-executor/src/arch/cortex_m.rs b/embassy-executor/src/arch/cortex_m.rs index 0806a22ab..fde862f3c 100644 --- a/embassy-executor/src/arch/cortex_m.rs +++ b/embassy-executor/src/arch/cortex_m.rs @@ -1,5 +1,3 @@ -const THREAD_PENDER: usize = usize::MAX; - #[export_name = "__pender"] #[cfg(any(feature = "executor-thread", feature = "executor-interrupt"))] fn __pender(context: *mut ()) { @@ -48,13 +46,14 @@ fn __pender(context: *mut ()) { pub use thread::*; #[cfg(feature = "executor-thread")] mod thread { + pub(super) const THREAD_PENDER: usize = usize::MAX; + use core::arch::asm; use core::marker::PhantomData; #[cfg(feature = "nightly")] pub use embassy_macros::main_cortex_m as main; - use crate::arch::THREAD_PENDER; use crate::{raw, Spawner}; /// Thread mode executor, using WFE/SEV. -- cgit From b9d4b18f14ad477c4b554498282ac467ff9cb823 Mon Sep 17 00:00:00 2001 From: Hailey Somerville Date: Thu, 14 Sep 2023 13:59:24 +1000 Subject: update UninitCell::write call in arch::wasm too --- embassy-executor/src/arch/wasm.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'embassy-executor/src/arch') diff --git a/embassy-executor/src/arch/wasm.rs b/embassy-executor/src/arch/wasm.rs index 934fd69e5..15aed867a 100644 --- a/embassy-executor/src/arch/wasm.rs +++ b/embassy-executor/src/arch/wasm.rs @@ -73,9 +73,10 @@ mod thread { pub fn start(&'static mut self, init: impl FnOnce(Spawner)) { unsafe { let executor = &self.inner; - self.ctx.closure.write(Closure::new(move |_| { + let future = Closure::new(move |_| { executor.poll(); - })); + }); + self.ctx.closure.write_in_place(|| future); init(self.inner.spawner()); } } -- cgit