TaskID CurrentTaskID (void);
CurrentTaskID returns the ID number of the currently running task. This routine can be called only from the noninterrupt execution level.
CurrentTaskID may be called only from task level, not from secondary or hardware interrupt level.