Fix task_end callback
This commit is contained in:
parent
8a8e450053
commit
c3efb85b85
@ -219,6 +219,9 @@ impl<F: Future + 'static> TaskStorage<F> {
|
|||||||
let mut cx = Context::from_waker(&waker);
|
let mut cx = Context::from_waker(&waker);
|
||||||
match future.poll(&mut cx) {
|
match future.poll(&mut cx) {
|
||||||
Poll::Ready(_) => {
|
Poll::Ready(_) => {
|
||||||
|
#[cfg(feature = "trace")]
|
||||||
|
let exec_ptr: *const SyncExecutor = this.raw.executor.load(Ordering::Relaxed);
|
||||||
|
|
||||||
// As the future has finished and this function will not be called
|
// As the future has finished and this function will not be called
|
||||||
// again, we can safely drop the future here.
|
// again, we can safely drop the future here.
|
||||||
this.future.drop_in_place();
|
this.future.drop_in_place();
|
||||||
@ -232,7 +235,7 @@ impl<F: Future + 'static> TaskStorage<F> {
|
|||||||
this.raw.state.despawn();
|
this.raw.state.despawn();
|
||||||
|
|
||||||
#[cfg(feature = "trace")]
|
#[cfg(feature = "trace")]
|
||||||
trace::task_end(self, &task);
|
trace::task_end(exec_ptr, &p);
|
||||||
}
|
}
|
||||||
Poll::Pending => {}
|
Poll::Pending => {}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -84,6 +84,7 @@
|
|||||||
//! 5. The executor has finished polling tasks. `_embassy_trace_executor_idle` is called.
|
//! 5. The executor has finished polling tasks. `_embassy_trace_executor_idle` is called.
|
||||||
|
|
||||||
#![allow(unused)]
|
#![allow(unused)]
|
||||||
|
|
||||||
use crate::raw::{SyncExecutor, TaskRef};
|
use crate::raw::{SyncExecutor, TaskRef};
|
||||||
|
|
||||||
#[cfg(not(feature = "rtos-trace"))]
|
#[cfg(not(feature = "rtos-trace"))]
|
||||||
@ -163,10 +164,10 @@ pub(crate) fn task_new(executor: &SyncExecutor, task: &TaskRef) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub(crate) fn task_end(executor: &SyncExecutor, task: &TaskRef) {
|
pub(crate) fn task_end(executor: *const SyncExecutor, task: &TaskRef) {
|
||||||
#[cfg(not(feature = "rtos-trace"))]
|
#[cfg(not(feature = "rtos-trace"))]
|
||||||
unsafe {
|
unsafe {
|
||||||
_embassy_trace_task_end(executor as *const _ as u32, task.as_ptr() as u32)
|
_embassy_trace_task_end(executor as u32, task.as_ptr() as u32)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user