aboutsummaryrefslogtreecommitdiff
path: root/embassy-executor/src
diff options
context:
space:
mode:
authorKat Perez <[email protected]>2025-05-06 09:23:39 -0400
committerKat Perez <[email protected]>2025-05-06 09:23:39 -0400
commit61f0f889a0dc89410218be725a43dcd967e53003 (patch)
treef92b462c681486caf00ff6df1736f8ac6ebf8d94 /embassy-executor/src
parent05d52decb2a98ad5111962b71e667c692e68c23e (diff)
add get/set for task name
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.