Make the pcObjectGetName() API function naming consistent - so rename pcTaskGetTaskName() to pcTaskGetName(), rename pcTimerGetTimerName() to pcTimerGetName() and add a #defines in FreeRTOS.h to make the changes backward compatible.

This commit is contained in:
Richard Barry 2016-03-29 17:16:34 +00:00
parent aeb03e5fa0
commit b9b64c0889
9 changed files with 25 additions and 32 deletions

View File

@ -181,10 +181,6 @@ extern "C" {
#define INCLUDE_xSemaphoreGetMutexHolder INCLUDE_xQueueGetMutexHolder #define INCLUDE_xSemaphoreGetMutexHolder INCLUDE_xQueueGetMutexHolder
#endif #endif
#ifndef INCLUDE_pcTaskGetTaskName
#define INCLUDE_pcTaskGetTaskName 0
#endif
#ifndef INCLUDE_xTaskGetTaskHandle #ifndef INCLUDE_xTaskGetTaskHandle
#define INCLUDE_xTaskGetTaskHandle 0 #define INCLUDE_xTaskGetTaskHandle 0
#endif #endif
@ -318,7 +314,7 @@ extern "C" {
#if ( configQUEUE_REGISTRY_SIZE < 1 ) #if ( configQUEUE_REGISTRY_SIZE < 1 )
#define vQueueAddToRegistry( xQueue, pcName ) #define vQueueAddToRegistry( xQueue, pcName )
#define vQueueUnregisterQueue( xQueue ) #define vQueueUnregisterQueue( xQueue )
#define pcQueueGetQueueName( xQueue ) #define pcQueueGetName( xQueue )
#endif #endif
#ifndef portPOINTER_SIZE_TYPE #ifndef portPOINTER_SIZE_TYPE
@ -839,6 +835,8 @@ V8 if desired. */
#define xCoRoutineHandle CoRoutineHandle_t #define xCoRoutineHandle CoRoutineHandle_t
#define pdTASK_HOOK_CODE TaskHookFunction_t #define pdTASK_HOOK_CODE TaskHookFunction_t
#define portTICK_RATE_MS portTICK_PERIOD_MS #define portTICK_RATE_MS portTICK_PERIOD_MS
#define pcTaskGetTaskName pcTaskGetName
#define pcTimerGetTimerName pcTimerGetName
/* Backward compatibility within the scheduler code only - these definitions /* Backward compatibility within the scheduler code only - these definitions
are not really required but are included for completeness. */ are not really required but are included for completeness. */

View File

@ -143,7 +143,7 @@ only for ports that are using the MPU. */
#define xTimerIsTimerActive MPU_xTimerIsTimerActive #define xTimerIsTimerActive MPU_xTimerIsTimerActive
#define xTimerGetTimerDaemonTaskHandle MPU_xTimerGetTimerDaemonTaskHandle #define xTimerGetTimerDaemonTaskHandle MPU_xTimerGetTimerDaemonTaskHandle
#define xTimerPendFunctionCall MPU_xTimerPendFunctionCall #define xTimerPendFunctionCall MPU_xTimerPendFunctionCall
#define pcTimerGetTimerName MPU_pcTimerGetTimerName #define pcTimerGetName MPU_pcTimerGetName
#define xTimerGenericCommand MPU_xTimerGenericCommand #define xTimerGenericCommand MPU_xTimerGenericCommand
#define xEventGroupCreate MPU_xEventGroupCreate #define xEventGroupCreate MPU_xEventGroupCreate

View File

@ -1617,7 +1617,7 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t pxMutex ) PRIVILEGED_FUNCTION
/* /*
* The queue registry is provided as a means for kernel aware debuggers to * The queue registry is provided as a means for kernel aware debuggers to
* locate queues, semaphores and mutexes. Call pcQueueGetQueueName() to look * locate queues, semaphores and mutexes. Call pcQueueGetName() to look
* up and return the name of a queue in the queue registry from the queue's * up and return the name of a queue in the queue registry from the queue's
* handle. * handle.
* *
@ -1627,7 +1627,7 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t pxMutex ) PRIVILEGED_FUNCTION
* returned. * returned.
*/ */
#if( configQUEUE_REGISTRY_SIZE > 0 ) #if( configQUEUE_REGISTRY_SIZE > 0 )
const char *pcQueueGetQueueName( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ const char *pcQueueGetName( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
#endif #endif
/* /*

View File

@ -1302,17 +1302,16 @@ UBaseType_t uxTaskGetNumberOfTasks( void ) PRIVILEGED_FUNCTION;
/** /**
* task. h * task. h
* <PRE>char *pcTaskGetTaskName( TaskHandle_t xTaskToQuery );</PRE> * <PRE>char *pcTaskGetName( TaskHandle_t xTaskToQuery );</PRE>
* *
* @return The text (human readable) name of the task referenced by the handle * @return The text (human readable) name of the task referenced by the handle
* xTaskToQuery. A task can query its own name by either passing in its own * xTaskToQuery. A task can query its own name by either passing in its own
* handle, or by setting xTaskToQuery to NULL. INCLUDE_pcTaskGetTaskName must be * handle, or by setting xTaskToQuery to NULL.
* set to 1 in FreeRTOSConfig.h for pcTaskGetTaskName() to be available.
* *
* \defgroup pcTaskGetTaskName pcTaskGetTaskName * \defgroup pcTaskGetName pcTaskGetName
* \ingroup TaskUtils * \ingroup TaskUtils
*/ */
char *pcTaskGetTaskName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ char *pcTaskGetName( TaskHandle_t xTaskToQuery ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
/** /**
* task. h * task. h

View File

@ -1256,7 +1256,7 @@ BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend, void
BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION; BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
/** /**
* const char * const pcTimerGetTimerName( TimerHandle_t xTimer ); * const char * const pcTimerGetName( TimerHandle_t xTimer );
* *
* Returns the name that was assigned to a timer when the timer was created. * Returns the name that was assigned to a timer when the timer was created.
* *
@ -1264,7 +1264,7 @@ BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvPar
* *
* @return The name assigned to the timer specified by the xTimer parameter. * @return The name assigned to the timer specified by the xTimer parameter.
*/ */
const char * pcTimerGetTimerName( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ const char * pcTimerGetName( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
/** /**
* TickType_t xTimerGetPeriod( TimerHandle_t xTimer ); * TickType_t xTimerGetPeriod( TimerHandle_t xTimer );

View File

@ -151,7 +151,7 @@ extern void *pxCurrentTCB;
/* First fill in the name and handle of the task that was in the Running /* First fill in the name and handle of the task that was in the Running
state when the exception occurred. */ state when the exception occurred. */
xRegisterDump.xCurrentTaskHandle = pxCurrentTCB; xRegisterDump.xCurrentTaskHandle = pxCurrentTCB;
xRegisterDump.pcCurrentTaskName = pcTaskGetTaskName( NULL ); xRegisterDump.pcCurrentTaskName = pcTaskGetName( NULL );
configASSERT( pulStackPointerOnFunctionEntry ); configASSERT( pulStackPointerOnFunctionEntry );

View File

@ -2283,7 +2283,7 @@ BaseType_t xReturn;
#if ( configQUEUE_REGISTRY_SIZE > 0 ) #if ( configQUEUE_REGISTRY_SIZE > 0 )
const char *pcQueueGetQueueName( QueueHandle_t xQueue ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ const char *pcQueueGetName( QueueHandle_t xQueue ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
{ {
UBaseType_t ux; UBaseType_t ux;
const char *pcReturn = NULL; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ const char *pcReturn = NULL; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */

View File

@ -2063,9 +2063,7 @@ UBaseType_t uxTaskGetNumberOfTasks( void )
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
#if ( INCLUDE_pcTaskGetTaskName == 1 ) char *pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
char *pcTaskGetTaskName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
{ {
TCB_t *pxTCB; TCB_t *pxTCB;
@ -2075,8 +2073,6 @@ UBaseType_t uxTaskGetNumberOfTasks( void )
configASSERT( pxTCB ); configASSERT( pxTCB );
return &( pxTCB->pcTaskName[ 0 ] ); return &( pxTCB->pcTaskName[ 0 ] );
} }
#endif /* INCLUDE_pcTaskGetTaskName */
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
#if ( INCLUDE_xTaskGetTaskHandle == 1 ) #if ( INCLUDE_xTaskGetTaskHandle == 1 )

View File

@ -453,7 +453,7 @@ TickType_t xReturn;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
const char * pcTimerGetTimerName( TimerHandle_t xTimer ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ const char * pcTimerGetName( TimerHandle_t xTimer ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
{ {
Timer_t *pxTimer = ( Timer_t * ) xTimer; Timer_t *pxTimer = ( Timer_t * ) xTimer;