mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-05 21:52:10 +01:00
Re-add our code for accessing the run time information in freertos.
This commit is contained in:
parent
72c84fc49c
commit
17f3c4d4e0
@ -1105,6 +1105,19 @@ void vTaskGetRunTimeStats( signed char *pcWriteBuffer ) PRIVILEGED_FUNCTION;
|
|||||||
*/
|
*/
|
||||||
unsigned portBASE_TYPE uxTaskGetStackHighWaterMark( xTaskHandle xTask ) 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
|
/* 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,
|
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
|
so the following two prototypes will cause a compilation error. This can be
|
||||||
|
@ -2282,6 +2282,22 @@ tskTCB *pxNewTCB;
|
|||||||
#endif
|
#endif
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
#if ( INCLUDE_uxTaskGetRunTime == 1 )
|
||||||
|
|
||||||
|
unsigned portBASE_TYPE uxTaskGetRunTime( xTaskHandle xTask )
|
||||||
|
{
|
||||||
|
unsigned long runTime;
|
||||||
|
|
||||||
|
tskTCB *pxTCB;
|
||||||
|
pxTCB = prvGetTCBFromHandle( xTask );
|
||||||
|
runTime = pxTCB->ulRunTimeCounter;
|
||||||
|
pxTCB->ulRunTimeCounter = 0;
|
||||||
|
return runTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
#if ( INCLUDE_uxTaskGetStackHighWaterMark == 1 )
|
#if ( INCLUDE_uxTaskGetStackHighWaterMark == 1 )
|
||||||
|
|
||||||
unsigned portBASE_TYPE uxTaskGetStackHighWaterMark( xTaskHandle xTask )
|
unsigned portBASE_TYPE uxTaskGetStackHighWaterMark( xTaskHandle xTask )
|
||||||
|
@ -1105,6 +1105,19 @@ void vTaskGetRunTimeStats( signed char *pcWriteBuffer ) PRIVILEGED_FUNCTION;
|
|||||||
*/
|
*/
|
||||||
unsigned portBASE_TYPE uxTaskGetStackHighWaterMark( xTaskHandle xTask ) 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
|
/* 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,
|
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
|
so the following two prototypes will cause a compilation error. This can be
|
||||||
|
@ -2262,6 +2262,22 @@ tskTCB *pxNewTCB;
|
|||||||
#endif
|
#endif
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
#if ( INCLUDE_uxTaskGetRunTime == 1 )
|
||||||
|
|
||||||
|
unsigned portBASE_TYPE uxTaskGetRunTime( xTaskHandle xTask )
|
||||||
|
{
|
||||||
|
unsigned long runTime;
|
||||||
|
|
||||||
|
tskTCB *pxTCB;
|
||||||
|
pxTCB = prvGetTCBFromHandle( xTask );
|
||||||
|
runTime = pxTCB->ulRunTimeCounter;
|
||||||
|
pxTCB->ulRunTimeCounter = 0;
|
||||||
|
return runTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
#if ( ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) )
|
#if ( ( configUSE_TRACE_FACILITY == 1 ) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) )
|
||||||
|
|
||||||
static unsigned short usTaskCheckFreeStackSpace( const unsigned char * pucStackByte )
|
static unsigned short usTaskCheckFreeStackSpace( const unsigned char * pucStackByte )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user