Remove the _embassy_time_schedule_wake magic

This commit is contained in:
ivmarkov 2022-10-26 18:05:27 +03:00
parent ac6995f9e6
commit 560eecdb73

View File

@ -444,14 +444,21 @@ pub unsafe fn wake_task(task: NonNull<TaskHeader>) {
} }
#[cfg(feature = "integrated-timers")] #[cfg(feature = "integrated-timers")]
#[no_mangle] struct TimerQueue;
unsafe fn _embassy_time_schedule_wake(at: Instant, waker: &core::task::Waker) {
let task = waker::task_from_waker(waker); #[cfg(feature = "integrated-timers")]
let task = task.as_ref(); impl embassy_time::queue::TimerQueue for TimerQueue {
let expires_at = task.expires_at.get(); fn schedule_wake(&'static self, at: Instant, waker: &core::task::Waker) {
task.expires_at.set(expires_at.min(at)); let task = waker::task_from_waker(waker);
let task = unsafe { task.as_ref() };
let expires_at = task.expires_at.get();
task.expires_at.set(expires_at.min(at));
}
} }
#[cfg(feature = "integrated-timers")]
embassy_time::timer_queue_impl!(static TIMER_QUEUE: TimerQueue = TimerQueue);
#[cfg(feature = "rtos-trace")] #[cfg(feature = "rtos-trace")]
impl rtos_trace::RtosTraceOSCallbacks for Executor { impl rtos_trace::RtosTraceOSCallbacks for Executor {
fn task_list() { fn task_list() {