aboutsummaryrefslogtreecommitdiff
path: root/embassy-executor/src
diff options
context:
space:
mode:
authorxoviat <[email protected]>2023-06-19 15:52:33 -0500
committerxoviat <[email protected]>2023-06-19 15:52:33 -0500
commitaaad9068156305e5f6f41ee4013e025083bd0668 (patch)
tree67a08c8a512e8791433891a3b6deec813fc4c578 /embassy-executor/src
parent35083b262b364387713f4273649b62180123182c (diff)
parent3c70f799a28f5f28d84fa8ee8b4b232f5e9aad82 (diff)
Merge branch 'main' of https://github.com/embassy-rs/embassy into can
Diffstat (limited to 'embassy-executor/src')
-rw-r--r--embassy-executor/src/arch/cortex_m.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/embassy-executor/src/arch/cortex_m.rs b/embassy-executor/src/arch/cortex_m.rs
index d6a55c4c7..94c8134d6 100644
--- a/embassy-executor/src/arch/cortex_m.rs
+++ b/embassy-executor/src/arch/cortex_m.rs
@@ -205,5 +205,20 @@ mod interrupt {
205 205
206 executor.spawner().make_send() 206 executor.spawner().make_send()
207 } 207 }
208
209 /// Get a SendSpawner for this executor
210 ///
211 /// This returns a [`SendSpawner`] you can use to spawn tasks on this
212 /// executor.
213 ///
214 /// This MUST only be called on an executor that has already been spawned.
215 /// The function will panic otherwise.
216 pub fn spawner(&'static self) -> crate::SendSpawner {
217 if !self.started.load(Ordering::Acquire) {
218 panic!("InterruptExecutor::spawner() called on uninitialized executor.");
219 }
220 let executor = unsafe { (&*self.executor.get()).assume_init_ref() };
221 executor.spawner().make_send()
222 }
208 } 223 }
209} 224}