From 508cd75ea3983fdb04d7760ee0c8f9f8daf484e0 Mon Sep 17 00:00:00 2001 From: rtel Date: Tue, 29 Mar 2016 17:16:34 +0000 Subject: [PATCH] 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. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2433 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- FreeRTOS/Source/include/FreeRTOS.h | 8 +++---- FreeRTOS/Source/include/mpu_wrappers.h | 2 +- FreeRTOS/Source/include/queue.h | 4 ++-- FreeRTOS/Source/include/task.h | 11 +++++----- FreeRTOS/Source/include/timers.h | 4 ++-- .../GCC/MicroBlazeV8/port_exceptions.c | 2 +- FreeRTOS/Source/queue.c | 2 +- FreeRTOS/Source/tasks.c | 22 ++++++++----------- FreeRTOS/Source/timers.c | 2 +- 9 files changed, 25 insertions(+), 32 deletions(-) diff --git a/FreeRTOS/Source/include/FreeRTOS.h b/FreeRTOS/Source/include/FreeRTOS.h index 8b8efca24..9f742825d 100644 --- a/FreeRTOS/Source/include/FreeRTOS.h +++ b/FreeRTOS/Source/include/FreeRTOS.h @@ -181,10 +181,6 @@ extern "C" { #define INCLUDE_xSemaphoreGetMutexHolder INCLUDE_xQueueGetMutexHolder #endif -#ifndef INCLUDE_pcTaskGetTaskName - #define INCLUDE_pcTaskGetTaskName 0 -#endif - #ifndef INCLUDE_xTaskGetTaskHandle #define INCLUDE_xTaskGetTaskHandle 0 #endif @@ -318,7 +314,7 @@ extern "C" { #if ( configQUEUE_REGISTRY_SIZE < 1 ) #define vQueueAddToRegistry( xQueue, pcName ) #define vQueueUnregisterQueue( xQueue ) - #define pcQueueGetQueueName( xQueue ) + #define pcQueueGetName( xQueue ) #endif #ifndef portPOINTER_SIZE_TYPE @@ -839,6 +835,8 @@ V8 if desired. */ #define xCoRoutineHandle CoRoutineHandle_t #define pdTASK_HOOK_CODE TaskHookFunction_t #define portTICK_RATE_MS portTICK_PERIOD_MS + #define pcTaskGetTaskName pcTaskGetName + #define pcTimerGetTimerName pcTimerGetName /* Backward compatibility within the scheduler code only - these definitions are not really required but are included for completeness. */ diff --git a/FreeRTOS/Source/include/mpu_wrappers.h b/FreeRTOS/Source/include/mpu_wrappers.h index 7ce1c4162..4a56b37d9 100644 --- a/FreeRTOS/Source/include/mpu_wrappers.h +++ b/FreeRTOS/Source/include/mpu_wrappers.h @@ -143,7 +143,7 @@ only for ports that are using the MPU. */ #define xTimerIsTimerActive MPU_xTimerIsTimerActive #define xTimerGetTimerDaemonTaskHandle MPU_xTimerGetTimerDaemonTaskHandle #define xTimerPendFunctionCall MPU_xTimerPendFunctionCall - #define pcTimerGetTimerName MPU_pcTimerGetTimerName + #define pcTimerGetName MPU_pcTimerGetName #define xTimerGenericCommand MPU_xTimerGenericCommand #define xEventGroupCreate MPU_xEventGroupCreate diff --git a/FreeRTOS/Source/include/queue.h b/FreeRTOS/Source/include/queue.h index 4ff7aa8d5..21d9e5f12 100644 --- a/FreeRTOS/Source/include/queue.h +++ b/FreeRTOS/Source/include/queue.h @@ -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 - * 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 * handle. * @@ -1627,7 +1627,7 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t pxMutex ) PRIVILEGED_FUNCTION * returned. */ #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 /* diff --git a/FreeRTOS/Source/include/task.h b/FreeRTOS/Source/include/task.h index 7af7a2e76..f546e1596 100644 --- a/FreeRTOS/Source/include/task.h +++ b/FreeRTOS/Source/include/task.h @@ -416,7 +416,7 @@ is used in assert() statements. */ * * @return If neither pxStackBuffer or pxTaskBuffer are NULL, then the task will * be created and pdPASS is returned. If either pxStackBuffer or pxTaskBuffer - * are NULL then the task will not be created and + * are NULL then the task will not be created and * errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY is returned. * * Example usage: @@ -1302,17 +1302,16 @@ UBaseType_t uxTaskGetNumberOfTasks( void ) PRIVILEGED_FUNCTION; /** * task. h - *
char *pcTaskGetTaskName( TaskHandle_t xTaskToQuery );
+ *
char *pcTaskGetName( TaskHandle_t xTaskToQuery );
* * @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 - * handle, or by setting xTaskToQuery to NULL. INCLUDE_pcTaskGetTaskName must be - * set to 1 in FreeRTOSConfig.h for pcTaskGetTaskName() to be available. + * handle, or by setting xTaskToQuery to NULL. * - * \defgroup pcTaskGetTaskName pcTaskGetTaskName + * \defgroup pcTaskGetName pcTaskGetName * \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 diff --git a/FreeRTOS/Source/include/timers.h b/FreeRTOS/Source/include/timers.h index cbf9bc0b8..1e029dbf6 100644 --- a/FreeRTOS/Source/include/timers.h +++ b/FreeRTOS/Source/include/timers.h @@ -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; /** - * 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. * @@ -1264,7 +1264,7 @@ BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvPar * * @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 ); diff --git a/FreeRTOS/Source/portable/GCC/MicroBlazeV8/port_exceptions.c b/FreeRTOS/Source/portable/GCC/MicroBlazeV8/port_exceptions.c index 783dad94a..ccbe24895 100644 --- a/FreeRTOS/Source/portable/GCC/MicroBlazeV8/port_exceptions.c +++ b/FreeRTOS/Source/portable/GCC/MicroBlazeV8/port_exceptions.c @@ -151,7 +151,7 @@ extern void *pxCurrentTCB; /* First fill in the name and handle of the task that was in the Running state when the exception occurred. */ xRegisterDump.xCurrentTaskHandle = pxCurrentTCB; - xRegisterDump.pcCurrentTaskName = pcTaskGetTaskName( NULL ); + xRegisterDump.pcCurrentTaskName = pcTaskGetName( NULL ); configASSERT( pulStackPointerOnFunctionEntry ); diff --git a/FreeRTOS/Source/queue.c b/FreeRTOS/Source/queue.c index 5f35f55bc..cb4df754b 100644 --- a/FreeRTOS/Source/queue.c +++ b/FreeRTOS/Source/queue.c @@ -2283,7 +2283,7 @@ BaseType_t xReturn; #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; const char *pcReturn = NULL; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ diff --git a/FreeRTOS/Source/tasks.c b/FreeRTOS/Source/tasks.c index a93fedcdf..989f43a43 100644 --- a/FreeRTOS/Source/tasks.c +++ b/FreeRTOS/Source/tasks.c @@ -2063,20 +2063,16 @@ UBaseType_t uxTaskGetNumberOfTasks( void ) } /*-----------------------------------------------------------*/ -#if ( INCLUDE_pcTaskGetTaskName == 1 ) - - char *pcTaskGetTaskName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ - { - TCB_t *pxTCB; - - /* If null is passed in here then the name of the calling task is being - queried. */ - pxTCB = prvGetTCBFromHandle( xTaskToQuery ); - configASSERT( pxTCB ); - return &( pxTCB->pcTaskName[ 0 ] ); - } +char *pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ +{ +TCB_t *pxTCB; -#endif /* INCLUDE_pcTaskGetTaskName */ + /* If null is passed in here then the name of the calling task is being + queried. */ + pxTCB = prvGetTCBFromHandle( xTaskToQuery ); + configASSERT( pxTCB ); + return &( pxTCB->pcTaskName[ 0 ] ); +} /*-----------------------------------------------------------*/ #if ( INCLUDE_xTaskGetTaskHandle == 1 ) diff --git a/FreeRTOS/Source/timers.c b/FreeRTOS/Source/timers.c index cd4df8a3d..5c0d4eb7e 100644 --- a/FreeRTOS/Source/timers.c +++ b/FreeRTOS/Source/timers.c @@ -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; -- 2.39.5