diff options
Diffstat (limited to 'embassy-executor/src')
| -rw-r--r-- | embassy-executor/src/raw/mod.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/embassy-executor/src/raw/mod.rs b/embassy-executor/src/raw/mod.rs index d9ea5c005..e8a5b8970 100644 --- a/embassy-executor/src/raw/mod.rs +++ b/embassy-executor/src/raw/mod.rs | |||
| @@ -328,7 +328,7 @@ impl SyncExecutor { | |||
| 328 | #[cfg(feature = "integrated-timers")] | 328 | #[cfg(feature = "integrated-timers")] |
| 329 | let alarm = unsafe { unwrap!(embassy_time_driver::allocate_alarm()) }; | 329 | let alarm = unsafe { unwrap!(embassy_time_driver::allocate_alarm()) }; |
| 330 | 330 | ||
| 331 | Self { | 331 | let this = Self { |
| 332 | run_queue: RunQueue::new(), | 332 | run_queue: RunQueue::new(), |
| 333 | pender, | 333 | pender, |
| 334 | 334 | ||
| @@ -336,7 +336,12 @@ impl SyncExecutor { | |||
| 336 | timer_queue: timer_queue::TimerQueue::new(), | 336 | timer_queue: timer_queue::TimerQueue::new(), |
| 337 | #[cfg(feature = "integrated-timers")] | 337 | #[cfg(feature = "integrated-timers")] |
| 338 | alarm, | 338 | alarm, |
| 339 | } | 339 | }; |
| 340 | |||
| 341 | #[cfg(feature = "integrated-timers")] | ||
| 342 | embassy_time_driver::set_alarm_callback(this.alarm, Self::alarm_callback, &this as *const _ as *mut ()); | ||
| 343 | |||
| 344 | this | ||
| 340 | } | 345 | } |
| 341 | 346 | ||
| 342 | /// Enqueue a task in the task queue | 347 | /// Enqueue a task in the task queue |
| @@ -374,9 +379,6 @@ impl SyncExecutor { | |||
| 374 | /// | 379 | /// |
| 375 | /// Same as [`Executor::poll`], plus you must only call this on the thread this executor was created. | 380 | /// Same as [`Executor::poll`], plus you must only call this on the thread this executor was created. |
| 376 | pub(crate) unsafe fn poll(&'static self) { | 381 | pub(crate) unsafe fn poll(&'static self) { |
| 377 | #[cfg(feature = "integrated-timers")] | ||
| 378 | embassy_time_driver::set_alarm_callback(self.alarm, Self::alarm_callback, self as *const _ as *mut ()); | ||
| 379 | |||
| 380 | #[allow(clippy::never_loop)] | 382 | #[allow(clippy::never_loop)] |
| 381 | loop { | 383 | loop { |
| 382 | #[cfg(feature = "integrated-timers")] | 384 | #[cfg(feature = "integrated-timers")] |
