Running task information

tamirmichael wrote on Monday, July 18, 2011:

Hello,

I have recetly started to port an existing application to FreeRTOS.
I am wondering: Is there a way for a piece of code to know which task is executing it? I have noticed the variable “pxCurrentTCB”, but that one is not exported outside of “tasks.c”, nor is its type.

Thanks in advance.

tamirmichael wrote on Monday, July 18, 2011:

Ah!

“xTaskGetCurrentTaskHandle”