diff options
| author | Dániel Buga <[email protected]> | 2023-08-14 16:46:02 +0200 |
|---|---|---|
| committer | Dániel Buga <[email protected]> | 2023-08-14 16:46:02 +0200 |
| commit | e4f3979ec8dd12fef1f44e78733917980045def0 (patch) | |
| tree | 3bc0174056123fccc68dd5466ed47974540e0f6e /embassy-executor/src | |
| parent | 07c36001271ab0a033a08a6535719729efb677c4 (diff) | |
Don't check context if only thread-mode is enabled
Diffstat (limited to 'embassy-executor/src')
| -rw-r--r-- | embassy-executor/src/arch/cortex_m.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/embassy-executor/src/arch/cortex_m.rs b/embassy-executor/src/arch/cortex_m.rs index 8fe5644d7..0806a22ab 100644 --- a/embassy-executor/src/arch/cortex_m.rs +++ b/embassy-executor/src/arch/cortex_m.rs | |||
| @@ -10,7 +10,8 @@ fn __pender(context: *mut ()) { | |||
| 10 | let context = context as usize; | 10 | let context = context as usize; |
| 11 | 11 | ||
| 12 | #[cfg(feature = "executor-thread")] | 12 | #[cfg(feature = "executor-thread")] |
| 13 | if context == THREAD_PENDER { | 13 | // Try to make Rust optimize the branching away if we only use thread mode. |
| 14 | if !cfg!(feature = "executor-interrupt") || context == THREAD_PENDER { | ||
| 14 | core::arch::asm!("sev"); | 15 | core::arch::asm!("sev"); |
| 15 | return; | 16 | return; |
| 16 | } | 17 | } |
