1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-02 10:24:11 +01:00

OP-315: Patch to FreeRTOS port to allow querying the run time for tasks. This

will need to be forward ported (and ideally pushed up stream) for FreeRTOS
updates

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2939 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
peabody124 2011-03-03 04:28:22 +00:00 committed by peabody124
parent b084ea7ea1
commit 267efe0b88
2 changed files with 25 additions and 0 deletions

View File

@ -1114,6 +1114,19 @@ unsigned long ulTaskEndTrace( void ) PRIVILEGED_FUNCTION;
*/
unsigned portBASE_TYPE uxTaskGetStackHighWaterMark( xTaskHandle xTask ) PRIVILEGED_FUNCTION;
/**
* task.h
* <PRE>unsigned portBASE_TYPE uxTaskGetRunTime( xTaskHandle xTask );</PRE>
*
* Returns the run time of selected task
*
* @param xTask Handle of the task associated with the stack to be checked.
* Set xTask to NULL to check the stack of the calling task.
*
* @return The run time of selected task
*/
unsigned portBASE_TYPE uxTaskGetRunTime( xTaskHandle xTask );
/* When using trace macros it is sometimes necessary to include tasks.h before
FreeRTOS.h. When this is done pdTASK_HOOK_CODE will not yet have been defined,
so the following two prototypes will cause a compilation error. This can be

View File

@ -2175,6 +2175,18 @@ tskTCB *pxNewTCB;
#endif
/*-----------------------------------------------------------*/
#if ( INCLUDE_uxTaskGetRunTime == 1 )
unsigned portBASE_TYPE uxTaskGetRunTime( xTaskHandle xTask )
{
tskTCB *pxTCB;
pxTCB = prvGetTCBFromHandle( xTask );
return pxTCB->ulRunTimeCounter;
}
#endif
/*-----------------------------------------------------------*/
#if ( ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) )
static unsigned short usTaskCheckFreeStackSpace( const unsigned char * pucStackByte )