aboutsummaryrefslogtreecommitdiff
path: root/embassy-executor/src/raw/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-executor/src/raw/mod.rs')
-rw-r--r--embassy-executor/src/raw/mod.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/embassy-executor/src/raw/mod.rs b/embassy-executor/src/raw/mod.rs
index 4b17d4982..bcd4ee432 100644
--- a/embassy-executor/src/raw/mod.rs
+++ b/embassy-executor/src/raw/mod.rs
@@ -97,8 +97,6 @@ pub(crate) struct TaskHeader {
97 #[cfg(feature = "trace")] 97 #[cfg(feature = "trace")]
98 pub(crate) name: Option<&'static str>, 98 pub(crate) name: Option<&'static str>,
99 #[cfg(feature = "trace")] 99 #[cfg(feature = "trace")]
100 pub(crate) id: u32,
101 #[cfg(feature = "trace")]
102 all_tasks_next: AtomicPtr<TaskHeader>, 100 all_tasks_next: AtomicPtr<TaskHeader>,
103} 101}
104 102
@@ -148,6 +146,12 @@ impl TaskRef {
148 pub(crate) fn as_ptr(self) -> *const TaskHeader { 146 pub(crate) fn as_ptr(self) -> *const TaskHeader {
149 self.ptr.as_ptr() 147 self.ptr.as_ptr()
150 } 148 }
149
150 /// Returns the task ID.
151 /// This can be used in combination with rtos-trace to match task names with IDs
152 pub fn id(&self) -> u32 {
153 self.as_ptr() as u32
154 }
151} 155}
152 156
153/// Raw storage in which a task can be spawned. 157/// Raw storage in which a task can be spawned.
@@ -192,8 +196,6 @@ impl<F: Future + 'static> TaskStorage<F> {
192 #[cfg(feature = "trace")] 196 #[cfg(feature = "trace")]
193 name: None, 197 name: None,
194 #[cfg(feature = "trace")] 198 #[cfg(feature = "trace")]
195 id: 0,
196 #[cfg(feature = "trace")]
197 all_tasks_next: AtomicPtr::new(core::ptr::null_mut()), 199 all_tasks_next: AtomicPtr::new(core::ptr::null_mut()),
198 }, 200 },
199 future: UninitCell::uninit(), 201 future: UninitCell::uninit(),