aboutsummaryrefslogtreecommitdiff
path: root/embassy-executor/src/raw/mod.rs
diff options
context:
space:
mode:
authorKat Perez <[email protected]>2025-05-08 13:40:32 -0400
committerKat Perez <[email protected]>2025-05-08 13:40:32 -0400
commit3b873bb6bb51b9bdac9272b5ec629a6ac54a89f7 (patch)
tree1c5016d8ace52014f62a34cc722b12fc6ef93716 /embassy-executor/src/raw/mod.rs
parent462d04c6d5a0fc6072cf9bdb0faa60da74ff46d2 (diff)
implement TaskRefTrace for tracing-only fields in TaskRef
Diffstat (limited to 'embassy-executor/src/raw/mod.rs')
-rw-r--r--embassy-executor/src/raw/mod.rs36
1 files changed, 0 insertions, 36 deletions
diff --git a/embassy-executor/src/raw/mod.rs b/embassy-executor/src/raw/mod.rs
index 882e4605b..e7a27035a 100644
--- a/embassy-executor/src/raw/mod.rs
+++ b/embassy-executor/src/raw/mod.rs
@@ -149,42 +149,6 @@ impl TaskRef {
149 pub(crate) fn as_ptr(self) -> *const TaskHeader { 149 pub(crate) fn as_ptr(self) -> *const TaskHeader {
150 self.ptr.as_ptr() 150 self.ptr.as_ptr()
151 } 151 }
152
153 /// Get the ID for a task
154 #[cfg(feature = "trace")]
155 pub fn as_id(self) -> u32 {
156 self.ptr.as_ptr() as u32
157 }
158
159 /// Get the name for a task
160 #[cfg(feature = "trace")]
161 pub fn name(&self) -> Option<&'static str> {
162 self.header().name
163 }
164
165 /// Set the name for a task
166 #[cfg(feature = "trace")]
167 pub fn set_name(&self, name: Option<&'static str>) {
168 unsafe {
169 let header_ptr = self.ptr.as_ptr() as *mut TaskHeader;
170 (*header_ptr).name = name;
171 }
172 }
173
174 /// Get the ID for a task
175 #[cfg(feature = "trace")]
176 pub fn id(&self) -> u32 {
177 self.header().id
178 }
179
180 /// Set the ID for a task
181 #[cfg(feature = "trace")]
182 pub fn set_id(&self, id: u32) {
183 unsafe {
184 let header_ptr = self.ptr.as_ptr() as *mut TaskHeader;
185 (*header_ptr).id = id;
186 }
187 }
188} 152}
189 153
190/// Raw storage in which a task can be spawned. 154/// Raw storage in which a task can be spawned.