Page 1 of 1

Access TaskName and priority# of currently running task

Posted: Fri May 30, 2008 10:18 am
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

Re: Access TaskName and priority# of currently running task

Posted: Fri May 30, 2008 12:13 pm
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;
}

Re: Access TaskName and priority# of currently running task

Posted: Fri May 30, 2008 12:17 pm
by pbreed
These functions were added to ucos.h and ucos.c they will appear in future releases.

Paul