diff options
| author | Tyler <[email protected]> | 2023-09-29 20:02:24 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-09-29 20:02:24 -0600 |
| commit | 2f9b59c5cf21f1e2761a9ccefdfd86f0edea829c (patch) | |
| tree | 8964744b4fb753cf98f6f413464106c4d2a72976 /embassy-executor/src/arch | |
| parent | ce91fb2bfc846570ef543a09396c428d70675245 (diff) | |
| parent | 95b3d9eb3b3657de3d7bc9c04f8fb83eae901640 (diff) | |
Merge branch 'main' into issue-1974-add-sai-driver
Diffstat (limited to 'embassy-executor/src/arch')
| -rw-r--r-- | embassy-executor/src/arch/cortex_m.rs | 5 | ||||
| -rw-r--r-- | embassy-executor/src/arch/wasm.rs | 5 |
2 files changed, 5 insertions, 5 deletions
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 @@ | |||
| 1 | const THREAD_PENDER: usize = usize::MAX; | ||
| 2 | |||
| 3 | #[export_name = "__pender"] | 1 | #[export_name = "__pender"] |
| 4 | #[cfg(any(feature = "executor-thread", feature = "executor-interrupt"))] | 2 | #[cfg(any(feature = "executor-thread", feature = "executor-interrupt"))] |
| 5 | fn __pender(context: *mut ()) { | 3 | fn __pender(context: *mut ()) { |
| @@ -48,13 +46,14 @@ fn __pender(context: *mut ()) { | |||
| 48 | pub use thread::*; | 46 | pub use thread::*; |
| 49 | #[cfg(feature = "executor-thread")] | 47 | #[cfg(feature = "executor-thread")] |
| 50 | mod thread { | 48 | mod thread { |
| 49 | pub(super) const THREAD_PENDER: usize = usize::MAX; | ||
| 50 | |||
| 51 | use core::arch::asm; | 51 | use core::arch::asm; |
| 52 | use core::marker::PhantomData; | 52 | use core::marker::PhantomData; |
| 53 | 53 | ||
| 54 | #[cfg(feature = "nightly")] | 54 | #[cfg(feature = "nightly")] |
| 55 | pub use embassy_macros::main_cortex_m as main; | 55 | pub use embassy_macros::main_cortex_m as main; |
| 56 | 56 | ||
| 57 | use crate::arch::THREAD_PENDER; | ||
| 58 | use crate::{raw, Spawner}; | 57 | use crate::{raw, Spawner}; |
| 59 | 58 | ||
| 60 | /// Thread mode executor, using WFE/SEV. | 59 | /// Thread mode executor, using WFE/SEV. |
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 { | |||
| 73 | pub fn start(&'static mut self, init: impl FnOnce(Spawner)) { | 73 | pub fn start(&'static mut self, init: impl FnOnce(Spawner)) { |
| 74 | unsafe { | 74 | unsafe { |
| 75 | let executor = &self.inner; | 75 | let executor = &self.inner; |
| 76 | self.ctx.closure.write(Closure::new(move |_| { | 76 | let future = Closure::new(move |_| { |
| 77 | executor.poll(); | 77 | executor.poll(); |
| 78 | })); | 78 | }); |
| 79 | self.ctx.closure.write_in_place(|| future); | ||
| 79 | init(self.inner.spawner()); | 80 | init(self.inner.spawner()); |
| 80 | } | 81 | } |
| 81 | } | 82 | } |
