How to get the active task ID?

bonmot wrote on Wednesday, January 03, 2007:

I want to put a printf in one function to see which tasks are calling it.
So is there anyway to get the active task ID?
Thanks

Paul

nobody wrote on Wednesday, January 03, 2007:

extern void *pxCurrentTCB

might work if you linker will allow it - most will.  Other than that add a get function to task.c to return pxCurrentTCB, or pxCurrentTCB->uxTCBNumber for the current number, or even pxCurrenTCB->pcTaskName for the name of the current task.

Have fun :slight_smile:

Dave.