Access TaskName and priority# of currently running task

Discussion to talk about software related topics only.
Post Reply
Ridgeglider
Posts: 513
Joined: Sat Apr 26, 2008 7:14 am

Access TaskName and priority# of currently running task

Post by Ridgeglider »

I have a task created with OSTaskCreatewName().
I'd like to use the name given to the task.
How do I access and perhaps print the name string?

If I am in any task, (not neccessarily one created with a name), how can I access the running task number, or I guess it would be the priority of the currently running task? For example if UserMain is running, how can I determine that the currently running task is the one equal to MAIN_PRIO?

Is there a way to access a list of all the running task priorities and names?

Thanks,
Henry
User avatar
pbreed
Posts: 1081
Joined: Thu Apr 24, 2008 3:58 pm

Re: Access TaskName and priority# of currently running task

Post by pbreed »

To get the task priority/ID
BYTE OSTaskID( void );



We should probably add

const char * OSTaskName();

this function would look like:

const char * OSTaskName()
{

return OSTCBCur->pOSTCBName;
}
User avatar
pbreed
Posts: 1081
Joined: Thu Apr 24, 2008 3:58 pm

Re: Access TaskName and priority# of currently running task

Post by pbreed »

These functions were added to ucos.h and ucos.c they will appear in future releases.

Paul
Post Reply