From dff3073a024a2282ae7de1abb3806873113c668b Mon Sep 17 00:00:00 2001 From: richardbarry Date: Wed, 16 Apr 2008 07:47:02 +0000 Subject: Update to V5.0.0. git-svn-id: https://freertos.svn.sourceforge.net/svnroot/freertos/trunk@322 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- Source/tasks.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'Source/tasks.c') diff --git a/Source/tasks.c b/Source/tasks.c index 6aae804b..6c980959 100644 --- a/Source/tasks.c +++ b/Source/tasks.c @@ -1,5 +1,5 @@ /* - FreeRTOS.org V4.8.0 - Copyright (C) 2003-2008 Richard Barry. + FreeRTOS.org V5.0.0 - Copyright (C) 2003-2008 Richard Barry. This file is part of the FreeRTOS.org distribution. @@ -86,8 +86,8 @@ typedef struct tskTaskControlBlock unsigned portBASE_TYPE uxBasePriority; #endif - #if ( configUSE_APPLICATION_TASK_HOOK == 1 ) - pdTASK_HOOK_CODE pxTaskHook; + #if ( configUSE_APPLICATION_TASK_TAG == 1 ) + pdTASK_HOOK_CODE pxTaskTag; #endif } tskTCB; @@ -1391,9 +1391,9 @@ inline void vTaskIncrementTick( void ) #endif /*-----------------------------------------------------------*/ -#if ( configUSE_APPLICATION_TASK_HOOK == 1 ) +#if ( configUSE_APPLICATION_TASK_TAG == 1 ) - void vTaskSetApplicationTaskHook( xTaskHandle xTask, pdTASK_HOOK_CODE pxHookFunction ) + void vTaskSetApplicationTaskTag( xTaskHandle xTask, pdTASK_HOOK_CODE pxTagValue ) { tskTCB *xTCB; @@ -1408,13 +1408,15 @@ inline void vTaskIncrementTick( void ) } /* Save the hook function in the TCB. */ - xTCB->pxTaskHook = pxHookFunction; + portENTER_CRITICAL(); + xTCB->pxTaskTag = pxTagValue; + portEXIT_CRITICAL(); } #endif /*-----------------------------------------------------------*/ -#if ( configUSE_APPLICATION_TASK_HOOK == 1 ) +#if ( configUSE_APPLICATION_TASK_TAG == 1 ) portBASE_TYPE xTaskCallApplicationTaskHook( xTaskHandle xTask, void *pvParameter ) { @@ -1431,9 +1433,9 @@ inline void vTaskIncrementTick( void ) xTCB = ( tskTCB * ) xTask; } - if( xTCB->pxTaskHook != NULL ) + if( xTCB->pxTaskTag != NULL ) { - xReturn = xTCB->pxTaskHook( pvParameter ); + xReturn = xTCB->pxTaskTag( pvParameter ); } else { @@ -1759,9 +1761,9 @@ static void prvInitialiseTCBVariables( tskTCB *pxTCB, const signed portCHAR * co } #endif - #if ( configUSE_APPLICATION_TASK_HOOK == 1 ) + #if ( configUSE_APPLICATION_TASK_TAG == 1 ) { - pxTCB->pxTaskHook = NULL; + pxTCB->pxTaskTag = NULL; } #endif } -- cgit v1.2.3