diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-11-20 23:14:02 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-11-20 23:14:02 +0000 |
| commit | 66756af2f07cb6327fb7b9266dee2f5e1e2c9f98 (patch) | |
| tree | 1113df882b7928608311c2f31153662ef1be9808 /embassy-executor/src/arch/cortex_m.rs | |
| parent | 851aa9cfaa1427f2f7a8e1203e58e9ec8dd93575 (diff) | |
| parent | 8ebe059ecb311ee949f92dde33f2cb8d972b0f7b (diff) | |
Merge pull request #3547 from bugadani/callback
Executor: Only set callback once
Diffstat (limited to 'embassy-executor/src/arch/cortex_m.rs')
| -rw-r--r-- | embassy-executor/src/arch/cortex_m.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/embassy-executor/src/arch/cortex_m.rs b/embassy-executor/src/arch/cortex_m.rs index 5c517e0a2..0c2af88a6 100644 --- a/embassy-executor/src/arch/cortex_m.rs +++ b/embassy-executor/src/arch/cortex_m.rs | |||
| @@ -98,6 +98,9 @@ mod thread { | |||
| 98 | /// | 98 | /// |
| 99 | /// This function never returns. | 99 | /// This function never returns. |
| 100 | pub fn run(&'static mut self, init: impl FnOnce(Spawner)) -> ! { | 100 | pub fn run(&'static mut self, init: impl FnOnce(Spawner)) -> ! { |
| 101 | unsafe { | ||
| 102 | self.inner.initialize(); | ||
| 103 | } | ||
| 101 | init(self.inner.spawner()); | 104 | init(self.inner.spawner()); |
| 102 | 105 | ||
| 103 | loop { | 106 | loop { |
| @@ -207,6 +210,9 @@ mod interrupt { | |||
| 207 | } | 210 | } |
| 208 | 211 | ||
| 209 | let executor = unsafe { (&*self.executor.get()).assume_init_ref() }; | 212 | let executor = unsafe { (&*self.executor.get()).assume_init_ref() }; |
| 213 | unsafe { | ||
| 214 | executor.initialize(); | ||
| 215 | } | ||
| 210 | 216 | ||
| 211 | unsafe { NVIC::unmask(irq) } | 217 | unsafe { NVIC::unmask(irq) } |
| 212 | 218 | ||
