diff options
Diffstat (limited to 'embassy-executor/src/spawner.rs')
| -rw-r--r-- | embassy-executor/src/spawner.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/embassy-executor/src/spawner.rs b/embassy-executor/src/spawner.rs index 2909d19a0..7550e8ea4 100644 --- a/embassy-executor/src/spawner.rs +++ b/embassy-executor/src/spawner.rs | |||
| @@ -36,12 +36,12 @@ impl<S> SpawnToken<S> { | |||
| 36 | } | 36 | } |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | /// Returns the task id if available, otherwise 0 | 39 | /// Returns the task ID if available, otherwise 0 |
| 40 | /// This can be used in combination with rtos-trace to match task names with id's | 40 | /// This can be used in combination with rtos-trace to match task names with IDs |
| 41 | pub fn id(&self) -> u32 { | 41 | pub fn id(&self) -> u32 { |
| 42 | match self.raw_task { | 42 | match self.raw_task { |
| 43 | None => 0, | 43 | None => 0, |
| 44 | Some(t) => t.as_ptr() as u32, | 44 | Some(t) => t.id(), |
| 45 | } | 45 | } |
| 46 | } | 46 | } |
| 47 | 47 | ||
| @@ -223,10 +223,8 @@ impl SpawnerTraceExt for Spawner { | |||
| 223 | 223 | ||
| 224 | match task { | 224 | match task { |
| 225 | Some(task) => { | 225 | Some(task) => { |
| 226 | // Set the name and ID when trace is enabled | 226 | // Set the name when trace is enabled |
| 227 | task.set_name(Some(name)); | 227 | task.set_name(Some(name)); |
| 228 | let task_id = task.as_ptr() as u32; | ||
| 229 | task.set_id(task_id); | ||
| 230 | 228 | ||
| 231 | unsafe { self.executor.spawn(task) }; | 229 | unsafe { self.executor.spawn(task) }; |
| 232 | Ok(()) | 230 | Ok(()) |
