Hi Rudy
MQX watchdog component provides a software watchdog for each task. If a single task starves or runs beyond certain timing constraints, the watchdong provides a way to detect the problem. Initially, the task starts its watchdog with a specific time value, and if the task fails to stop or restart the watchdog before that time expires, MQX calls a processor-unique, application-supplied expiry function that can initiate error recovery.
From the td_ptr, it is a pointer to the task descriptor of the task, it contains various information about the state of the task.
typedef struct td_struct
{
/*!
* \brief A pointer to the next TD in the queue (for whatever queue this
* task is currently in).
*
* This field MUST be the first field in the TD.
*/
struct td_struct *TD_NEXT;
/*!
* \brief A pointer to the previous TD in the queue (for whatever queue this
* task is currently in).
*/
struct td_struct *TD_PREV;
/*! \brief The current state that this task is in. */
_mqx_uint STATE;
/*! \brief The Task id of the task that this task descriptor represents. */
_task_id TASK_ID;
/*! \brief The Start of the Stack. */
void *STACK_BASE;
/*!
* \brief If the task is blocked, then this is a pointer to the task's current
* stack value, otherwise it is a pointer to the task's stack at the time of
* the last block.
*/
void *STACK_PTR;
/*! \brief The other end of the Stack. */
void *STACK_LIMIT;
/*! \brief The Ready Queue upon which to place the task, when it is ready to run. */
struct ready_q_struct *MY_QUEUE;
...
...
}
you can get task id by this function
_task_id _task_get_id_from_td(void * td_ptr);
Regards
Daniel