aboutsummaryrefslogtreecommitdiff
path: root/embassy-executor/src
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-executor/src')
-rw-r--r--embassy-executor/src/raw/mod.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/embassy-executor/src/raw/mod.rs b/embassy-executor/src/raw/mod.rs
index 2928848b8..3f4e06350 100644
--- a/embassy-executor/src/raw/mod.rs
+++ b/embassy-executor/src/raw/mod.rs
@@ -151,6 +151,21 @@ impl TaskRef {
151 pub fn as_id(self) -> u32 { 151 pub fn as_id(self) -> u32 {
152 self.ptr.as_ptr() as u32 152 self.ptr.as_ptr() as u32
153 } 153 }
154
155 /// Get the name for a task
156 #[cfg(feature = "trace")]
157 pub fn name(&self) -> Option<&'static str> {
158 self.header().name
159 }
160
161 /// Set the name for a task
162 #[cfg(feature = "trace")]
163 pub fn set_name(&self, name: Option<&'static str>) {
164 unsafe {
165 let header_ptr = self.ptr.as_ptr() as *mut TaskHeader;
166 (*header_ptr).name = name;
167 }
168 }
154} 169}
155 170
156/// Raw storage in which a task can be spawned. 171/// Raw storage in which a task can be spawned.