/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+ FreeRTOS V8.0.0 - Copyright (C) 2014 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750. */\r
\r
\r
-/* Constants used with the cRxLock and xTxLock structure members. */\r
+/* Constants used with the xRxLock and xTxLock structure members. */\r
#define queueUNLOCKED ( ( BaseType_t ) -1 )\r
#define queueLOCKED_UNMODIFIED ( ( BaseType_t ) 0 )\r
\r
more user friendly. */\r
typedef struct QUEUE_REGISTRY_ITEM\r
{\r
- char *pcQueueName; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+ const char *pcQueueName; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
QueueHandle_t xHandle;\r
} QueueRegistryItem_t;\r
\r
\r
#if ( configUSE_RECURSIVE_MUTEXES == 1 )\r
\r
- BaseType_t xQueueTakeMutexRecursive( QueueHandle_t xMutex, TickType_t xBlockTime )\r
+ BaseType_t xQueueTakeMutexRecursive( QueueHandle_t xMutex, TickType_t xTicksToWait )\r
{\r
BaseType_t xReturn;\r
Queue_t * const pxMutex = ( Queue_t * ) xMutex;\r
}\r
else\r
{\r
- xReturn = xQueueGenericReceive( pxMutex, NULL, xBlockTime, pdFALSE );\r
+ xReturn = xQueueGenericReceive( pxMutex, NULL, xTicksToWait, pdFALSE );\r
\r
/* pdPASS will only be returned if we successfully obtained the mutex,\r
we may have blocked to reach here. */\r
link: http://www.freertos.org/RTOS-Cortex-M3-M4.html */\r
portASSERT_IF_INTERRUPT_PRIORITY_INVALID();\r
\r
- /* Similar to xQueueGenericSend, except we don't block if there is no room\r
- in the queue. Also we don't directly wake a task that was blocked on a\r
- queue read, instead we return a flag to say whether a context switch is\r
- required or not (i.e. has a task with a higher priority than us been woken\r
- by this post). */\r
+ /* Similar to xQueueGenericSend, except without blocking if there is no room\r
+ in the queue. Also don't directly wake a task that was blocked on a queue\r
+ read, instead return a flag to say whether a context switch is required or \r
+ not (i.e. has a task with a higher priority than us been woken by this \r
+ post). */\r
uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();\r
{\r
if( ( pxQueue->uxMessagesWaiting < pxQueue->uxLength ) || ( xCopyPosition == queueOVERWRITE ) )\r
\r
prvCopyDataToQueue( pxQueue, pvItemToQueue, xCopyPosition );\r
\r
- /* If the queue is locked we do not alter the event list. This will\r
+ /* The event list is not altered if the queue is locked. This will\r
be done when the queue is unlocked later. */\r
if( pxQueue->xTxLock == queueUNLOCKED )\r
{\r
\r
#if ( configQUEUE_REGISTRY_SIZE > 0 )\r
\r
- void vQueueAddToRegistry( QueueHandle_t xQueue, char *pcQueueName ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+ void vQueueAddToRegistry( QueueHandle_t xQueue, const char *pcQueueName ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
{\r
UBaseType_t ux;\r
\r
/* Store the information on this queue. */\r
xQueueRegistry[ ux ].pcQueueName = pcQueueName;\r
xQueueRegistry[ ux ].xHandle = xQueue;\r
+\r
+ traceQUEUE_REGISTRY_ADD( xQueue, pcQueueName );\r
break;\r
}\r
else\r
\r
#if ( configUSE_QUEUE_SETS == 1 )\r
\r
- BaseType_t xQueueAddToSet( QueueSetMember_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet )\r
+ BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet )\r
{\r
BaseType_t xReturn;\r
\r
- if( ( ( Queue_t * ) xQueueOrSemaphore )->pxQueueSetContainer != NULL )\r
- {\r
- /* Cannot add a queue/semaphore to more than one queue set. */\r
- xReturn = pdFAIL;\r
- }\r
- else if( ( ( Queue_t * ) xQueueOrSemaphore )->uxMessagesWaiting != ( UBaseType_t ) 0 )\r
- {\r
- /* Cannot add a queue/semaphore to a queue set if there are already\r
- items in the queue/semaphore. */\r
- xReturn = pdFAIL;\r
- }\r
- else\r
+ taskENTER_CRITICAL();\r
{\r
- taskENTER_CRITICAL();\r
+ if( ( ( Queue_t * ) xQueueOrSemaphore )->pxQueueSetContainer != NULL )\r
+ {\r
+ /* Cannot add a queue/semaphore to more than one queue set. */\r
+ xReturn = pdFAIL;\r
+ }\r
+ else if( ( ( Queue_t * ) xQueueOrSemaphore )->uxMessagesWaiting != ( UBaseType_t ) 0 )\r
+ {\r
+ /* Cannot add a queue/semaphore to a queue set if there are already\r
+ items in the queue/semaphore. */\r
+ xReturn = pdFAIL;\r
+ }\r
+ else\r
{\r
( ( Queue_t * ) xQueueOrSemaphore )->pxQueueSetContainer = xQueueSet;\r
+ xReturn = pdPASS;\r
}\r
- taskEXIT_CRITICAL();\r
- xReturn = pdPASS;\r
}\r
+ taskEXIT_CRITICAL();\r
\r
return xReturn;\r
}\r
\r
#if ( configUSE_QUEUE_SETS == 1 )\r
\r
- BaseType_t xQueueRemoveFromSet( QueueSetMember_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet )\r
+ BaseType_t xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet )\r
{\r
BaseType_t xReturn;\r
Queue_t * const pxQueueOrSemaphore = ( Queue_t * ) xQueueOrSemaphore;\r
\r
#if ( configUSE_QUEUE_SETS == 1 )\r
\r
- QueueSetMember_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet, TickType_t const xBlockTimeTicks )\r
+ QueueSetMemberHandle_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet, TickType_t const xTicksToWait )\r
{\r
- QueueSetMember_t xReturn = NULL;\r
+ QueueSetMemberHandle_t xReturn = NULL;\r
\r
- ( void ) xQueueGenericReceive( ( QueueHandle_t ) xQueueSet, &xReturn, xBlockTimeTicks, pdFALSE ); /*lint !e961 Casting from one typedef to another is not redundant. */\r
+ ( void ) xQueueGenericReceive( ( QueueHandle_t ) xQueueSet, &xReturn, xTicksToWait, pdFALSE ); /*lint !e961 Casting from one typedef to another is not redundant. */\r
return xReturn;\r
}\r
\r
\r
#if ( configUSE_QUEUE_SETS == 1 )\r
\r
- QueueSetMember_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet )\r
+ QueueSetMemberHandle_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet )\r
{\r
- QueueSetMember_t xReturn = NULL;\r
+ QueueSetMemberHandle_t xReturn = NULL;\r
\r
( void ) xQueueReceiveFromISR( ( QueueHandle_t ) xQueueSet, &xReturn, NULL ); /*lint !e961 Casting from one typedef to another is not redundant. */\r
return xReturn;\r
Queue_t *pxQueueSetContainer = pxQueue->pxQueueSetContainer;\r
BaseType_t xReturn = pdFALSE;\r
\r
+ /* This function must be called form a critical section. */\r
+ \r
configASSERT( pxQueueSetContainer );\r
configASSERT( pxQueueSetContainer->uxMessagesWaiting < pxQueueSetContainer->uxLength );\r
\r