Getting a tasks name from the Task ID?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Getting a tasks name from the Task ID?

1,433 次查看
ironsean
Contributor V

Did some searching through the community and the docs, but I haven't seen anything yet.

Is it possible to find the task name using just the Task ID?

More info:
I'm trying to create a simple error logging task to log errors onto an SD card. I had the idea that instead of making MFS available to multiple tasks and dealing with potential concurrent writes, I could instead have a single error logging task, with a lw-message queue to act as input. It's pretty simple to pass an error code and taskID to that logging task, but would like to be able to parse that back into the task name before I write it to the file.

Thanks,

Sean

2 回复数

1,267 次查看
danielchen
NXP TechSupport
NXP TechSupport

HI Sean:

I think you can use the function "_task_get_template_ptr", the input is task id, the output is template, and the task name is an element of the template.


Have a nice day,
Daniel

1,267 次查看
ironsean
Contributor V

Thanks, I'm giving that a try now.

Also, I've noticed there's an undocumented (that I can find) MFS_Error_text() function that takes an error code and returns a text string of the MFS error. Do you happen to know if there is anything else similar, or a more generic function in MQX?

Sean

0 项奖励
回复