|
|
@ -2845,26 +2845,44 @@ BaseType_t xSwitchRequired = pdFALSE;
|
|
|
|
|
|
|
|
|
|
|
|
TaskHookFunction_t xTaskGetApplicationTaskTag( TaskHandle_t xTask )
|
|
|
|
TaskHookFunction_t xTaskGetApplicationTaskTag( TaskHandle_t xTask )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TCB_t *xTCB;
|
|
|
|
TCB_t *pxTCB;
|
|
|
|
TaskHookFunction_t xReturn;
|
|
|
|
TaskHookFunction_t xReturn;
|
|
|
|
|
|
|
|
|
|
|
|
/* If xTask is NULL then we are setting our own task hook. */
|
|
|
|
/* If xTask is NULL then set the calling task's hook. */
|
|
|
|
if( xTask == NULL )
|
|
|
|
pxTCB = prvGetTCBFromHandle( xTask );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Save the hook function in the TCB. A critical section is required as
|
|
|
|
|
|
|
|
the value can be accessed from an interrupt. */
|
|
|
|
|
|
|
|
taskENTER_CRITICAL();
|
|
|
|
{
|
|
|
|
{
|
|
|
|
xTCB = ( TCB_t * ) pxCurrentTCB;
|
|
|
|
xReturn = pxTCB->pxTaskTag;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
taskEXIT_CRITICAL();
|
|
|
|
{
|
|
|
|
|
|
|
|
xTCB = xTask;
|
|
|
|
return xReturn;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* configUSE_APPLICATION_TASK_TAG */
|
|
|
|
|
|
|
|
/*-----------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if ( configUSE_APPLICATION_TASK_TAG == 1 )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TaskHookFunction_t xTaskGetApplicationTaskTagFromISR( TaskHandle_t xTask )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
TCB_t *pxTCB;
|
|
|
|
|
|
|
|
TaskHookFunction_t xReturn;
|
|
|
|
|
|
|
|
UBaseType_t uxSavedInterruptStatus;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* If xTask is NULL then set the calling task's hook. */
|
|
|
|
|
|
|
|
pxTCB = prvGetTCBFromHandle( xTask );
|
|
|
|
|
|
|
|
|
|
|
|
/* Save the hook function in the TCB. A critical section is required as
|
|
|
|
/* Save the hook function in the TCB. A critical section is required as
|
|
|
|
the value can be accessed from an interrupt. */
|
|
|
|
the value can be accessed from an interrupt. */
|
|
|
|
taskENTER_CRITICAL();
|
|
|
|
uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
|
|
|
|
{
|
|
|
|
{
|
|
|
|
xReturn = xTCB->pxTaskTag;
|
|
|
|
xReturn = pxTCB->pxTaskTag;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
taskEXIT_CRITICAL();
|
|
|
|
portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
|
|
|
|
|
|
|
|
|
|
|
|
return xReturn;
|
|
|
|
return xReturn;
|
|
|
|
}
|
|
|
|
}
|
|
|
|