Add the pcTimerGetTimerName() API function.

This commit is contained in:
Richard Barry 2014-03-28 14:41:15 +00:00
parent 887fcd04f4
commit ef7f3c5320
4 changed files with 21 additions and 13 deletions

View File

@ -291,6 +291,8 @@ unsigned portBASE_TYPE xTimer;
( void * ) xTimer, /* An identifier for the timer as all the auto reload timers use the same callback. */ ( void * ) xTimer, /* An identifier for the timer as all the auto reload timers use the same callback. */
prvAutoReloadTimerCallback ); /* The callback to be called when the timer expires. */ prvAutoReloadTimerCallback ); /* The callback to be called when the timer expires. */
configASSERT( strcmp( pcTimerGetTimerName( xAutoReloadTimers[ xTimer ] ), "FR Timer" ) == 0 );
if( xAutoReloadTimers[ xTimer ] == NULL ) if( xAutoReloadTimers[ xTimer ] == NULL )
{ {
xTestStatus = pdFAIL; xTestStatus = pdFAIL;

View File

@ -82,19 +82,6 @@
* <HR> * <HR>
*/ */
/*
Changes from V3.0.0
+ CreationCount sizes changed from unsigned portBASE_TYPE to
unsigned short to minimize the risk of overflowing.
+ Reset of usLastCreationCount added
Changes from V3.1.0
+ Changed the dummy calculation to use variables of type long, rather than
float. This allows the file to be used with ports that do not support
floating point.
*/
#include <stdlib.h> #include <stdlib.h>

View File

@ -1094,6 +1094,17 @@ BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend, void
*/ */
BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, TickType_t xTicksToWait ); BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, TickType_t xTicksToWait );
/**
* const char * const pcTimerGetTimerName( TimerHandle_t xTimer );
*
* Returns the name that was asigned to a timer when the timer was created.
*
* @param xTimer The handle of the timer being queried.
*
* @return The name asigned to the timer specified by the xTimer parameter.
*/
const char * const pcTimerGetTimerName( TimerHandle_t xTimer );
/* /*
* Functions beyond this part are not part of the public API and are intended * Functions beyond this part are not part of the public API and are intended
* for use by the kernel only. * for use by the kernel only.

View File

@ -363,6 +363,14 @@ DaemonTaskMessage_t xMessage;
#endif #endif
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
const char * const pcTimerGetTimerName( TimerHandle_t xTimer )
{
Timer_t *pxTimer = ( Timer_t * ) xTimer;
return pxTimer->pcTimerName;
}
/*-----------------------------------------------------------*/
static void prvProcessExpiredTimer( const TickType_t xNextExpireTime, const TickType_t xTimeNow ) static void prvProcessExpiredTimer( const TickType_t xNextExpireTime, const TickType_t xTimeNow )
{ {
BaseType_t xResult; BaseType_t xResult;