mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-09-28 12:50:37 +00:00
Add possibility to get the id of a task to be able to use it with rtos-trace
Files: spawner.rs
This commit is contained in:
parent
38f26137fc
commit
edadc28f02
@ -34,6 +34,15 @@ impl<S> SpawnToken<S> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the task if available, otherwise 0
|
||||
/// This can be used in combination with rtos-trace to match task names with id's
|
||||
pub fn id(&self) -> u32 {
|
||||
match self.raw_task {
|
||||
None => 0,
|
||||
Some(t) => t.as_ptr() as u32,
|
||||
}
|
||||
}
|
||||
|
||||
/// Return a SpawnToken that represents a failed spawn.
|
||||
pub fn new_failed() -> Self {
|
||||
Self {
|
||||
|
Loading…
x
Reference in New Issue
Block a user