]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/queue.c
Multiple tidy up, documentation corrections and typo corrections highlighted by Tamas...
[freertos] / FreeRTOS / Source / queue.c
index b9024d5354da203f0b1c4920fc1e882846f9f82f..43ceaca9279003fb25648d304481d61c9bb2f293 100644 (file)
@@ -1,48 +1,38 @@
 /*\r
-    FreeRTOS V7.4.2 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+    FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+    All rights reserved\r
 \r
-    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
-    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
 \r
     ***************************************************************************\r
      *                                                                       *\r
-     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
-     *    Complete, revised, and edited pdf reference manuals are also       *\r
-     *    available.                                                         *\r
+     *    FreeRTOS provides completely free yet professionally developed,    *\r
+     *    robust, strictly quality controlled, supported, and cross          *\r
+     *    platform software that has become a de facto standard.             *\r
      *                                                                       *\r
-     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
-     *    ensuring you get running as quickly as possible and with an        *\r
-     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
-     *    the FreeRTOS project to continue with its mission of providing     *\r
-     *    professional grade, cross platform, de facto standard solutions    *\r
-     *    for microcontrollers - completely free of charge!                  *\r
+     *    Help yourself get started quickly and support the FreeRTOS         *\r
+     *    project by purchasing a FreeRTOS tutorial book, reference          *\r
+     *    manual, or both from: http://www.FreeRTOS.org/Documentation        *\r
      *                                                                       *\r
-     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
-     *                                                                       *\r
-     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *    Thank you!                                                         *\r
      *                                                                       *\r
     ***************************************************************************\r
 \r
-\r
     This file is part of the FreeRTOS distribution.\r
 \r
     FreeRTOS is free software; you can redistribute it and/or modify it under\r
     the terms of the GNU General Public License (version 2) as published by the\r
-    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
 \r
-    >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to\r
-    distribute a combined work that includes FreeRTOS without being obliged to\r
-    provide the source code for proprietary components outside of the FreeRTOS\r
-    kernel.\r
+    >>! NOTE: The modification to the GPL is included to allow you to distribute\r
+    >>! a combined work that includes FreeRTOS without being obliged to provide\r
+    >>! the source code for proprietary components outside of the FreeRTOS\r
+    >>! kernel.\r
 \r
     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
-    FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
-    details. You should have received a copy of the GNU General Public License\r
-    and the FreeRTOS license exception along with FreeRTOS; if not it can be\r
-    viewed here: http://www.freertos.org/a00114.html and also obtained by\r
-    writing to Real Time Engineers Ltd., contact details for whom are available\r
-    on the FreeRTOS WEB site.\r
+    FOR A PARTICULAR PURPOSE.  Full license text is available from the following\r
+    link: http://www.freertos.org/a00114.html\r
 \r
     1 tab == 4 spaces!\r
 \r
      *                                                                       *\r
     ***************************************************************************\r
 \r
-\r
     http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
     license and Real Time Engineers Ltd. contact details.\r
 \r
     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
-    including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
-    fully thread aware and reentrant UDP/IP stack.\r
+    including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
+    compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
 \r
     http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
-    Integrity Systems, who sell the code with commercial support,\r
-    indemnification and middleware, under the OpenRTOS brand.\r
+    Integrity Systems to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
+    licenses offer ticketed support, indemnification and middleware.\r
 \r
     http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
     engineered and independently SIL3 certified version for use in safety and\r
     mission critical applications that require provable dependability.\r
+\r
+    1 tab == 4 spaces!\r
 */\r
 \r
 #include <stdlib.h>\r
@@ -88,14 +79,17 @@ task.h is included from an application file. */
        #include "croutine.h"\r
 #endif\r
 \r
-#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE\r
+/* Lint e961 and e750 are suppressed as a MISRA exception justified because the\r
+MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be defined for the\r
+header files above, but not in this file, in order to generate the correct\r
+privileged Vs unprivileged linkage and placement. */\r
+#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750. */\r
+\r
 \r
 /* Constants used with the cRxLock and xTxLock structure members. */\r
 #define queueUNLOCKED                                  ( ( signed portBASE_TYPE ) -1 )\r
 #define queueLOCKED_UNMODIFIED                 ( ( signed portBASE_TYPE ) 0 )\r
 \r
-#define queueERRONEOUS_UNBLOCK                 ( -1 )\r
-\r
 /* When the xQUEUE structure is used to represent a base queue its pcHead and\r
 pcTail members are used as pointers into the queue storage area.  When the\r
 xQUEUE structure is used to represent a mutex pcHead and pcTail pointers are\r
@@ -114,9 +108,15 @@ structure member). */
 /* Semaphores do not actually store or copy data, so have an item size of\r
 zero. */\r
 #define queueSEMAPHORE_QUEUE_ITEM_LENGTH ( ( unsigned portBASE_TYPE ) 0 )\r
-#define queueDONT_BLOCK                                         ( ( portTickType ) 0U )\r
 #define queueMUTEX_GIVE_BLOCK_TIME              ( ( portTickType ) 0U )\r
 \r
+#if( configUSE_PREEMPTION == 0 )\r
+       /* If the cooperative scheduler is being used then a yield should not be\r
+       performed just because a higher priority task has been woken. */\r
+       #define queueYIELD_IF_USING_PREEMPTION()\r
+#else\r
+       #define queueYIELD_IF_USING_PREEMPTION() portYIELD_WITHIN_API()\r
+#endif\r
 \r
 /*\r
  * Definition of the queue used by the scheduler.\r
@@ -212,14 +212,14 @@ static void prvCopyDataToQueue( xQUEUE *pxQueue, const void *pvItemToQueue, port
 /*\r
  * Copies an item out of a queue.\r
  */\r
-static void prvCopyDataFromQueue( xQUEUE * const pxQueue, const void *pvBuffer ) PRIVILEGED_FUNCTION;\r
+static void prvCopyDataFromQueue( xQUEUE * const pxQueue, void * const pvBuffer ) PRIVILEGED_FUNCTION;\r
 \r
 #if ( configUSE_QUEUE_SETS == 1 )\r
        /*\r
         * Checks to see if a queue is a member of a queue set, and if so, notifies\r
         * the queue set that the queue contains data.\r
         */\r
-       static portBASE_TYPE prvNotifyQueueSetContainer( xQUEUE *pxQueue, portBASE_TYPE xCopyPosition ) PRIVILEGED_FUNCTION;\r
+       static portBASE_TYPE prvNotifyQueueSetContainer( const xQUEUE * const pxQueue, portBASE_TYPE xCopyPosition ) PRIVILEGED_FUNCTION;\r
 #endif\r
 \r
 /*-----------------------------------------------------------*/\r
@@ -245,9 +245,8 @@ static void prvCopyDataFromQueue( xQUEUE * const pxQueue, const void *pvBuffer )
 \r
 portBASE_TYPE xQueueGenericReset( xQueueHandle xQueue, portBASE_TYPE xNewQueue )\r
 {\r
-xQUEUE *pxQueue;\r
+xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;\r
 \r
-       pxQueue = ( xQUEUE * ) xQueue;\r
        configASSERT( pxQueue );\r
 \r
        taskENTER_CRITICAL();\r
@@ -263,14 +262,14 @@ xQUEUE *pxQueue;
                {\r
                        /* If there are tasks blocked waiting to read from the queue, then\r
                        the tasks will remain blocked as after this function exits the queue\r
-                       will still be empty.  If there are tasks blocked waiting to     write to\r
+                       will still be empty.  If there are tasks blocked waiting to write to\r
                        the queue, then one should be unblocked as after this function exits\r
                        it will be possible to write to it. */\r
                        if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) == pdFALSE )\r
                        {\r
                                if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) == pdTRUE )\r
                                {\r
-                                       portYIELD_WITHIN_API();\r
+                                       queueYIELD_IF_USING_PREEMPTION();\r
                                }\r
                        }\r
                }\r
@@ -307,7 +306,7 @@ xQueueHandle xReturn = NULL;
                {\r
                        /* Create the list of pointers to queue items.  The queue is one byte\r
                        longer than asked for to make wrap checking easier/faster. */\r
-                       xQueueSizeInBytes = ( size_t ) ( uxQueueLength * uxItemSize ) + ( size_t ) 1;\r
+                       xQueueSizeInBytes = ( size_t ) ( uxQueueLength * uxItemSize ) + ( size_t ) 1; /*lint !e961 MISRA exception as the casts are only redundant for some ports. */\r
 \r
                        pxNewQueue->pcHead = ( signed char * ) pvPortMalloc( xQueueSizeInBytes );\r
                        if( pxNewQueue->pcHead != NULL )\r
@@ -316,7 +315,7 @@ xQueueHandle xReturn = NULL;
                                queue type is defined. */\r
                                pxNewQueue->uxLength = uxQueueLength;\r
                                pxNewQueue->uxItemSize = uxItemSize;\r
-                               xQueueGenericReset( pxNewQueue, pdTRUE );\r
+                               ( void ) xQueueGenericReset( pxNewQueue, pdTRUE );\r
 \r
                                #if ( configUSE_TRACE_FACILITY == 1 )\r
                                {\r
@@ -398,7 +397,7 @@ xQueueHandle xReturn = NULL;
                        traceCREATE_MUTEX( pxNewQueue );\r
 \r
                        /* Start with the semaphore in the expected state. */\r
-                       xQueueGenericSend( pxNewQueue, NULL, ( portTickType ) 0U, queueSEND_TO_BACK );\r
+                       ( void ) xQueueGenericSend( pxNewQueue, NULL, ( portTickType ) 0U, queueSEND_TO_BACK );\r
                }\r
                else\r
                {\r
@@ -419,7 +418,7 @@ xQueueHandle xReturn = NULL;
        void *pxReturn;\r
 \r
                /* This function is called by xSemaphoreGetMutexHolder(), and should not\r
-               be called directly.  Note:  This is is a good way of determining if the\r
+               be called directly.  Note:  This is a good way of determining if the\r
                calling task is the mutex holder, but not a good way of determining the\r
                identity of the mutex holder, as the holder may change between the\r
                following critical section exiting and the function returning. */\r
@@ -447,9 +446,8 @@ xQueueHandle xReturn = NULL;
        portBASE_TYPE xQueueGiveMutexRecursive( xQueueHandle xMutex )\r
        {\r
        portBASE_TYPE xReturn;\r
-       xQUEUE *pxMutex;\r
+       xQUEUE * const pxMutex = ( xQUEUE * ) xMutex;\r
 \r
-               pxMutex = ( xQUEUE * ) xMutex;\r
                configASSERT( pxMutex );\r
 \r
                /* If this is the task that holds the mutex then pxMutexHolder will not\r
@@ -458,7 +456,7 @@ xQueueHandle xReturn = NULL;
                this is the only condition we are interested in it does not matter if\r
                pxMutexHolder is accessed simultaneously by another task.  Therefore no\r
                mutual exclusion is required to test the pxMutexHolder variable. */\r
-               if( pxMutex->pxMutexHolder == ( void * ) xTaskGetCurrentTaskHandle() )\r
+               if( pxMutex->pxMutexHolder == ( void * ) xTaskGetCurrentTaskHandle() ) /*lint !e961 Not a redundant cast as xTaskHandle is a typedef. */\r
                {\r
                        traceGIVE_MUTEX_RECURSIVE( pxMutex );\r
 \r
@@ -470,11 +468,11 @@ xQueueHandle xReturn = NULL;
                        ( pxMutex->u.uxRecursiveCallCount )--;\r
 \r
                        /* Have we unwound the call count? */\r
-                       if( pxMutex->u.uxRecursiveCallCount == 0 )\r
+                       if( pxMutex->u.uxRecursiveCallCount == ( unsigned portBASE_TYPE ) 0 )\r
                        {\r
                                /* Return the mutex.  This will automatically unblock any other\r
                                task that might be waiting to access the mutex. */\r
-                               xQueueGenericSend( pxMutex, NULL, queueMUTEX_GIVE_BLOCK_TIME, queueSEND_TO_BACK );\r
+                               ( void ) xQueueGenericSend( pxMutex, NULL, queueMUTEX_GIVE_BLOCK_TIME, queueSEND_TO_BACK );\r
                        }\r
 \r
                        xReturn = pdPASS;\r
@@ -498,9 +496,8 @@ xQueueHandle xReturn = NULL;
        portBASE_TYPE xQueueTakeMutexRecursive( xQueueHandle xMutex, portTickType xBlockTime )\r
        {\r
        portBASE_TYPE xReturn;\r
-       xQUEUE *pxMutex;\r
+       xQUEUE * const pxMutex = ( xQUEUE * ) xMutex;\r
 \r
-               pxMutex = ( xQUEUE * ) xMutex;\r
                configASSERT( pxMutex );\r
 \r
                /* Comments regarding mutual exclusion as per those within\r
@@ -508,7 +505,7 @@ xQueueHandle xReturn = NULL;
 \r
                traceTAKE_MUTEX_RECURSIVE( pxMutex );\r
 \r
-               if( pxMutex->pxMutexHolder == ( void * )  xTaskGetCurrentTaskHandle() )\r
+               if( pxMutex->pxMutexHolder == ( void * ) xTaskGetCurrentTaskHandle() ) /*lint !e961 Cast is not redundant as xTaskHandle is a typedef. */\r
                {\r
                        ( pxMutex->u.uxRecursiveCallCount )++;\r
                        xReturn = pdPASS;\r
@@ -537,11 +534,14 @@ xQueueHandle xReturn = NULL;
 \r
 #if ( configUSE_COUNTING_SEMAPHORES == 1 )\r
 \r
-       xQueueHandle xQueueCreateCountingSemaphore( unsigned portBASE_TYPE uxCountValue, unsigned portBASE_TYPE uxInitialCount )\r
+       xQueueHandle xQueueCreateCountingSemaphore( unsigned portBASE_TYPE uxMaxCount, unsigned portBASE_TYPE uxInitialCount )\r
        {\r
        xQueueHandle xHandle;\r
 \r
-               xHandle = xQueueGenericCreate( ( unsigned portBASE_TYPE ) uxCountValue, queueSEMAPHORE_QUEUE_ITEM_LENGTH, queueQUEUE_TYPE_COUNTING_SEMAPHORE );\r
+               configASSERT( uxMaxCount != 0 );\r
+               configASSERT( uxInitialCount <= uxMaxCount );\r
+\r
+               xHandle = xQueueGenericCreate( uxMaxCount, queueSEMAPHORE_QUEUE_ITEM_LENGTH, queueQUEUE_TYPE_COUNTING_SEMAPHORE );\r
 \r
                if( xHandle != NULL )\r
                {\r
@@ -565,12 +565,17 @@ signed portBASE_TYPE xQueueGenericSend( xQueueHandle xQueue, const void * const
 {\r
 signed portBASE_TYPE xEntryTimeSet = pdFALSE;\r
 xTimeOutType xTimeOut;\r
-xQUEUE *pxQueue;\r
+xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;\r
 \r
-       pxQueue = ( xQUEUE * ) xQueue;\r
        configASSERT( pxQueue );\r
        configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( unsigned portBASE_TYPE ) 0U ) ) );\r
        configASSERT( !( ( xCopyPosition == queueOVERWRITE ) && ( pxQueue->uxLength != 1 ) ) );\r
+       #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )\r
+       {\r
+               configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );\r
+       }\r
+       #endif\r
+\r
 \r
        /* This function relaxes the coding standard somewhat to allow return\r
        statements within the function itself.  This is done in the interest\r
@@ -597,7 +602,7 @@ xQUEUE *pxQueue;
                                                        /* The queue is a member of a queue set, and posting\r
                                                        to the queue set caused a higher priority task to\r
                                                        unblock. A context switch is required. */\r
-                                                       portYIELD_WITHIN_API();\r
+                                                       queueYIELD_IF_USING_PREEMPTION();\r
                                                }\r
                                        }\r
                                        else\r
@@ -612,7 +617,7 @@ xQUEUE *pxQueue;
                                                                our own so yield immediately.  Yes it is ok to\r
                                                                do this from within the critical section - the\r
                                                                kernel takes care of that. */\r
-                                                               portYIELD_WITHIN_API();\r
+                                                               queueYIELD_IF_USING_PREEMPTION();\r
                                                        }\r
                                                }\r
                                        }\r
@@ -629,7 +634,7 @@ xQUEUE *pxQueue;
                                                        our own so yield immediately.  Yes it is ok to do\r
                                                        this from within the critical section - the kernel\r
                                                        takes care of that. */\r
-                                                       portYIELD_WITHIN_API();\r
+                                                       queueYIELD_IF_USING_PREEMPTION();\r
                                                }\r
                                        }\r
                                }\r
@@ -661,6 +666,10 @@ xQUEUE *pxQueue;
                                        vTaskSetTimeOutState( &xTimeOut );\r
                                        xEntryTimeSet = pdTRUE;\r
                                }\r
+                               else\r
+                               {\r
+                                       /* Entry time was already set. */\r
+                               }\r
                        }\r
                }\r
                taskEXIT_CRITICAL();\r
@@ -724,9 +733,8 @@ xQUEUE *pxQueue;
        {\r
        signed portBASE_TYPE xEntryTimeSet = pdFALSE;\r
        xTimeOutType xTimeOut;\r
-       xQUEUE *pxQueue;\r
+       xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;\r
 \r
-               pxQueue = ( xQUEUE * ) xQueue;\r
                configASSERT( pxQueue );\r
                configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( unsigned portBASE_TYPE ) 0U ) ) );\r
 \r
@@ -804,9 +812,8 @@ xQUEUE *pxQueue;
        signed portBASE_TYPE xEntryTimeSet = pdFALSE;\r
        xTimeOutType xTimeOut;\r
        signed char *pcOriginalReadPosition;\r
-       xQUEUE *pxQueue;\r
+       xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;\r
 \r
-               pxQueue = ( xQUEUE * ) xQueue;\r
                configASSERT( pxQueue );\r
                configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( unsigned portBASE_TYPE ) 0U ) ) );\r
 \r
@@ -825,7 +832,7 @@ xQUEUE *pxQueue;
                                        {\r
                                                traceQUEUE_RECEIVE( pxQueue );\r
 \r
-                                               /* We are actually removing data. */\r
+                                               /* Data is actually being removed (not just peeked). */\r
                                                --( pxQueue->uxMessagesWaiting );\r
 \r
                                                #if ( configUSE_MUTEXES == 1 )\r
@@ -834,7 +841,7 @@ xQUEUE *pxQueue;
                                                        {\r
                                                                /* Record the information required to implement\r
                                                                priority inheritance should it become necessary. */\r
-                                                               pxQueue->pxMutexHolder = ( void * ) xTaskGetCurrentTaskHandle();\r
+                                                               pxQueue->pxMutexHolder = ( signed char * ) xTaskGetCurrentTaskHandle();\r
                                                        }\r
                                                }\r
                                                #endif\r
@@ -902,11 +909,11 @@ xQUEUE *pxQueue;
                                                {\r
                                                        if( pxQueue->uxQueueType == queueQUEUE_IS_MUTEX )\r
                                                        {\r
-                                                               portENTER_CRITICAL();\r
+                                                               taskENTER_CRITICAL();\r
                                                                {\r
                                                                        vTaskPriorityInherit( ( void * ) pxQueue->pxMutexHolder );\r
                                                                }\r
-                                                               portEXIT_CRITICAL();\r
+                                                               taskEXIT_CRITICAL();\r
                                                        }\r
                                                }\r
                                                #endif\r
@@ -934,13 +941,28 @@ signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle xQueue, const void *
 {\r
 signed portBASE_TYPE xReturn;\r
 unsigned portBASE_TYPE uxSavedInterruptStatus;\r
-xQUEUE *pxQueue;\r
+xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;\r
 \r
-       pxQueue = ( xQUEUE * ) xQueue;\r
        configASSERT( pxQueue );\r
        configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( unsigned portBASE_TYPE ) 0U ) ) );\r
        configASSERT( !( ( xCopyPosition == queueOVERWRITE ) && ( pxQueue->uxLength != 1 ) ) );\r
 \r
+       /* RTOS ports that support interrupt nesting have the concept of a maximum\r
+       system call (or maximum API call) interrupt priority.  Interrupts that are\r
+       above the maximum system call priority are kept permanently enabled, even\r
+       when the RTOS kernel is in a critical section, but cannot make any calls to\r
+       FreeRTOS API functions.  If configASSERT() is defined in FreeRTOSConfig.h\r
+       then portASSERT_IF_INTERRUPT_PRIORITY_INVALID() will result in an assertion\r
+       failure if a FreeRTOS API function is called from an interrupt that has been\r
+       assigned a priority above the configured maximum system call priority.\r
+       Only FreeRTOS functions that end in FromISR can be called from interrupts\r
+       that have been assigned a priority at or (logically) below the maximum\r
+       system call     interrupt priority.  FreeRTOS maintains a separate interrupt\r
+       safe API to ensure interrupt entry is as fast and as simple as possible.\r
+       More information (albeit Cortex-M specific) is provided on the following\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
@@ -1032,12 +1054,16 @@ signed portBASE_TYPE xQueueGenericReceive( xQueueHandle xQueue, void * const pvB
 signed portBASE_TYPE xEntryTimeSet = pdFALSE;\r
 xTimeOutType xTimeOut;\r
 signed char *pcOriginalReadPosition;\r
-xQUEUE *pxQueue;\r
+xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;\r
 \r
-       pxQueue = ( xQUEUE * ) xQueue;\r
        configASSERT( pxQueue );\r
        configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( unsigned portBASE_TYPE ) 0U ) ) );\r
-\r
+       #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )\r
+       {\r
+               configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );\r
+       }\r
+       #endif\r
+       \r
        /* This function relaxes the coding standard somewhat to allow return\r
        statements within the function itself.  This is done in the interest\r
        of execution time efficiency. */\r
@@ -1050,7 +1076,7 @@ xQUEUE *pxQueue;
                        the highest priority task wanting to access the queue. */\r
                        if( pxQueue->uxMessagesWaiting > ( unsigned portBASE_TYPE ) 0 )\r
                        {\r
-                               /* Remember the read position in case the queue is only being \r
+                               /* Remember the read position in case the queue is only being\r
                                peeked. */\r
                                pcOriginalReadPosition = pxQueue->u.pcReadFrom;\r
 \r
@@ -1069,7 +1095,7 @@ xQUEUE *pxQueue;
                                                {\r
                                                        /* Record the information required to implement\r
                                                        priority inheritance should it become necessary. */\r
-                                                       pxQueue->pxMutexHolder = ( void * ) xTaskGetCurrentTaskHandle();\r
+                                                       pxQueue->pxMutexHolder = ( signed char * ) xTaskGetCurrentTaskHandle(); /*lint !e961 Cast is not redundant as xTaskHandle is a typedef. */\r
                                                }\r
                                        }\r
                                        #endif\r
@@ -1078,7 +1104,7 @@ xQUEUE *pxQueue;
                                        {\r
                                                if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) == pdTRUE )\r
                                                {\r
-                                                       portYIELD_WITHIN_API();\r
+                                                       queueYIELD_IF_USING_PREEMPTION();\r
                                                }\r
                                        }\r
                                }\r
@@ -1099,7 +1125,7 @@ xQUEUE *pxQueue;
                                                if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )\r
                                                {\r
                                                        /* The task waiting has a higher priority than this task. */\r
-                                                       portYIELD_WITHIN_API();\r
+                                                       queueYIELD_IF_USING_PREEMPTION();\r
                                                }\r
                                        }\r
                                }\r
@@ -1124,6 +1150,10 @@ xQUEUE *pxQueue;
                                        vTaskSetTimeOutState( &xTimeOut );\r
                                        xEntryTimeSet = pdTRUE;\r
                                }\r
+                               else\r
+                               {\r
+                                       /* Entry time was already set. */\r
+                               }\r
                        }\r
                }\r
                taskEXIT_CRITICAL();\r
@@ -1145,11 +1175,11 @@ xQUEUE *pxQueue;
                                {\r
                                        if( pxQueue->uxQueueType == queueQUEUE_IS_MUTEX )\r
                                        {\r
-                                               portENTER_CRITICAL();\r
+                                               taskENTER_CRITICAL();\r
                                                {\r
                                                        vTaskPriorityInherit( ( void * ) pxQueue->pxMutexHolder );\r
                                                }\r
-                                               portEXIT_CRITICAL();\r
+                                               taskEXIT_CRITICAL();\r
                                        }\r
                                }\r
                                #endif\r
@@ -1183,12 +1213,27 @@ signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle xQueue, void * const pvB
 {\r
 signed portBASE_TYPE xReturn;\r
 unsigned portBASE_TYPE uxSavedInterruptStatus;\r
-xQUEUE *pxQueue;\r
+xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;\r
 \r
-       pxQueue = ( xQUEUE * ) xQueue;\r
        configASSERT( pxQueue );\r
        configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( unsigned portBASE_TYPE ) 0U ) ) );\r
 \r
+       /* RTOS ports that support interrupt nesting have the concept of a maximum\r
+       system call (or maximum API call) interrupt priority.  Interrupts that are\r
+       above the maximum system call priority are kept permanently enabled, even\r
+       when the RTOS kernel is in a critical section, but cannot make any calls to\r
+       FreeRTOS API functions.  If configASSERT() is defined in FreeRTOSConfig.h\r
+       then portASSERT_IF_INTERRUPT_PRIORITY_INVALID() will result in an assertion\r
+       failure if a FreeRTOS API function is called from an interrupt that has been\r
+       assigned a priority above the configured maximum system call priority.\r
+       Only FreeRTOS functions that end in FromISR can be called from interrupts\r
+       that have been assigned a priority at or (logically) below the maximum\r
+       system call     interrupt priority.  FreeRTOS maintains a separate interrupt\r
+       safe API to ensure interrupt entry is as fast and as simple as possible.\r
+       More information (albeit Cortex-M specific) is provided on the following\r
+       link: http://www.freertos.org/RTOS-Cortex-M3-M4.html */\r
+       portASSERT_IF_INTERRUPT_PRIORITY_INVALID();\r
+\r
        uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();\r
        {\r
                /* Cannot block in an ISR, so check there is data available. */\r
@@ -1199,9 +1244,9 @@ xQUEUE *pxQueue;
                        prvCopyDataFromQueue( pxQueue, pvBuffer );\r
                        --( pxQueue->uxMessagesWaiting );\r
 \r
-                       /* If the queue is locked the event list will not be modified.  \r
-                       Instead update the lock count so the task that unlocks the queue \r
-                       will know that an ISR has removed data while the queue was \r
+                       /* If the queue is locked the event list will not be modified.\r
+                       Instead update the lock count so the task that unlocks the queue\r
+                       will know that an ISR has removed data while the queue was\r
                        locked. */\r
                        if( pxQueue->xRxLock == queueUNLOCKED )\r
                        {\r
@@ -1239,17 +1284,32 @@ xQUEUE *pxQueue;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-signed portBASE_TYPE xQueuePeekFromISR( xQueueHandle xQueue, void * const pvBuffer )\r
+signed portBASE_TYPE xQueuePeekFromISR( xQueueHandle xQueue,  void * const pvBuffer )\r
 {\r
 signed portBASE_TYPE xReturn;\r
 unsigned portBASE_TYPE uxSavedInterruptStatus;\r
 signed char *pcOriginalReadPosition;\r
-xQUEUE *pxQueue;\r
+xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;\r
 \r
-       pxQueue = ( xQUEUE * ) xQueue;\r
        configASSERT( pxQueue );\r
        configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( unsigned portBASE_TYPE ) 0U ) ) );\r
 \r
+       /* RTOS ports that support interrupt nesting have the concept of a maximum\r
+       system call (or maximum API call) interrupt priority.  Interrupts that are\r
+       above the maximum system call priority are kept permanently enabled, even\r
+       when the RTOS kernel is in a critical section, but cannot make any calls to\r
+       FreeRTOS API functions.  If configASSERT() is defined in FreeRTOSConfig.h\r
+       then portASSERT_IF_INTERRUPT_PRIORITY_INVALID() will result in an assertion\r
+       failure if a FreeRTOS API function is called from an interrupt that has been\r
+       assigned a priority above the configured maximum system call priority.\r
+       Only FreeRTOS functions that end in FromISR can be called from interrupts\r
+       that have been assigned a priority at or (logically) below the maximum\r
+       system call     interrupt priority.  FreeRTOS maintains a separate interrupt\r
+       safe API to ensure interrupt entry is as fast and as simple as possible.\r
+       More information (albeit Cortex-M specific) is provided on the following\r
+       link: http://www.freertos.org/RTOS-Cortex-M3-M4.html */\r
+       portASSERT_IF_INTERRUPT_PRIORITY_INVALID();\r
+\r
        uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();\r
        {\r
                /* Cannot block in an ISR, so check there is data available. */\r
@@ -1288,7 +1348,23 @@ unsigned portBASE_TYPE uxReturn;
        taskEXIT_CRITICAL();\r
 \r
        return uxReturn;\r
-}\r
+} /*lint !e818 Pointer cannot be declared const as xQueue is a typedef not pointer. */\r
+/*-----------------------------------------------------------*/\r
+\r
+unsigned portBASE_TYPE uxQueueSpacesAvailable( const xQueueHandle xQueue )\r
+{\r
+unsigned portBASE_TYPE uxReturn;\r
+xQUEUE *pxQueue;\r
+\r
+       pxQueue = ( xQUEUE * ) xQueue;\r
+       configASSERT( pxQueue );\r
+\r
+       taskENTER_CRITICAL();\r
+               uxReturn = pxQueue->uxLength - pxQueue->uxMessagesWaiting;\r
+       taskEXIT_CRITICAL();\r
+\r
+       return uxReturn;\r
+} /*lint !e818 Pointer cannot be declared const as xQueue is a typedef not pointer. */\r
 /*-----------------------------------------------------------*/\r
 \r
 unsigned portBASE_TYPE uxQueueMessagesWaitingFromISR( const xQueueHandle xQueue )\r
@@ -1300,14 +1376,13 @@ unsigned portBASE_TYPE uxReturn;
        uxReturn = ( ( xQUEUE * ) xQueue )->uxMessagesWaiting;\r
 \r
        return uxReturn;\r
-}\r
+} /*lint !e818 Pointer cannot be declared const as xQueue is a typedef not pointer. */\r
 /*-----------------------------------------------------------*/\r
 \r
 void vQueueDelete( xQueueHandle xQueue )\r
 {\r
-xQUEUE *pxQueue;\r
+xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;\r
 \r
-       pxQueue = ( xQUEUE * ) xQueue;\r
        configASSERT( pxQueue );\r
 \r
        traceQUEUE_DELETE( pxQueue );\r
@@ -1368,29 +1443,29 @@ static void prvCopyDataToQueue( xQUEUE *pxQueue, const void *pvItemToQueue, port
        }\r
        else if( xPosition == queueSEND_TO_BACK )\r
        {\r
-               memcpy( ( void * ) pxQueue->pcWriteTo, pvItemToQueue, ( size_t ) pxQueue->uxItemSize );\r
+               ( void ) memcpy( ( void * ) pxQueue->pcWriteTo, pvItemToQueue, ( size_t ) pxQueue->uxItemSize ); /*lint !e961 !e418 MISRA exception as the casts are only redundant for some ports, plus previous logic ensures a null pointer can only be passed to memcpy() if the copy size is 0. */\r
                pxQueue->pcWriteTo += pxQueue->uxItemSize;\r
-               if( pxQueue->pcWriteTo >= pxQueue->pcTail )\r
+               if( pxQueue->pcWriteTo >= pxQueue->pcTail ) /*lint !e946 MISRA exception justified as comparison of pointers is the cleanest solution. */\r
                {\r
                        pxQueue->pcWriteTo = pxQueue->pcHead;\r
                }\r
        }\r
        else\r
        {\r
-               memcpy( ( void * ) pxQueue->u.pcReadFrom, pvItemToQueue, ( size_t ) pxQueue->uxItemSize );\r
+               ( void ) memcpy( ( void * ) pxQueue->u.pcReadFrom, pvItemToQueue, ( size_t ) pxQueue->uxItemSize ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */\r
                pxQueue->u.pcReadFrom -= pxQueue->uxItemSize;\r
-               if( pxQueue->u.pcReadFrom < pxQueue->pcHead )\r
+               if( pxQueue->u.pcReadFrom < pxQueue->pcHead ) /*lint !e946 MISRA exception justified as comparison of pointers is the cleanest solution. */\r
                {\r
                        pxQueue->u.pcReadFrom = ( pxQueue->pcTail - pxQueue->uxItemSize );\r
                }\r
 \r
                if( xPosition == queueOVERWRITE )\r
                {\r
-                       if( pxQueue->uxMessagesWaiting > 0 )\r
+                       if( pxQueue->uxMessagesWaiting > ( unsigned portBASE_TYPE ) 0 )\r
                        {\r
-                               /* An item is not being added but overwritten, so subtract \r
-                               one from the recorded number of items in the queue so when \r
-                               one is added again below the number of recorded items remains \r
+                               /* An item is not being added but overwritten, so subtract\r
+                               one from the recorded number of items in the queue so when\r
+                               one is added again below the number of recorded items remains\r
                                correct. */\r
                                --( pxQueue->uxMessagesWaiting );\r
                        }\r
@@ -1401,16 +1476,16 @@ static void prvCopyDataToQueue( xQUEUE *pxQueue, const void *pvItemToQueue, port
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-static void prvCopyDataFromQueue( xQUEUE * const pxQueue, const void *pvBuffer )\r
+static void prvCopyDataFromQueue( xQUEUE * const pxQueue, void * const pvBuffer )\r
 {\r
        if( pxQueue->uxQueueType != queueQUEUE_IS_MUTEX )\r
        {\r
                pxQueue->u.pcReadFrom += pxQueue->uxItemSize;\r
-               if( pxQueue->u.pcReadFrom >= pxQueue->pcTail )\r
+               if( pxQueue->u.pcReadFrom >= pxQueue->pcTail ) /*lint !e946 MISRA exception justified as use of the relational operator is the cleanest solutions. */\r
                {\r
                        pxQueue->u.pcReadFrom = pxQueue->pcHead;\r
                }\r
-               memcpy( ( void * ) pvBuffer, ( void * ) pxQueue->u.pcReadFrom, ( size_t ) pxQueue->uxItemSize );\r
+               ( void ) memcpy( ( void * ) pvBuffer, ( void * ) pxQueue->u.pcReadFrom, ( size_t ) pxQueue->uxItemSize ); /*lint !e961 !e418 MISRA exception as the casts are only redundant for some ports.  Also previous logic ensures a null pointer can only be passed to memcpy() when the count is 0. */\r
        }\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -1520,7 +1595,7 @@ signed portBASE_TYPE xReturn;
 \r
        taskENTER_CRITICAL();\r
        {\r
-               if( pxQueue->uxMessagesWaiting == 0 )\r
+               if( pxQueue->uxMessagesWaiting == ( unsigned portBASE_TYPE )  0 )\r
                {\r
                        xReturn = pdTRUE;\r
                }\r
@@ -1540,7 +1615,7 @@ signed portBASE_TYPE xQueueIsQueueEmptyFromISR( const xQueueHandle xQueue )
 signed portBASE_TYPE xReturn;\r
 \r
        configASSERT( xQueue );\r
-       if( ( ( xQUEUE * ) xQueue )->uxMessagesWaiting == 0 )\r
+       if( ( ( xQUEUE * ) xQueue )->uxMessagesWaiting == ( unsigned portBASE_TYPE ) 0 )\r
        {\r
                xReturn = pdTRUE;\r
        }\r
@@ -1550,7 +1625,7 @@ signed portBASE_TYPE xReturn;
        }\r
 \r
        return xReturn;\r
-}\r
+} /*lint !e818 xQueue could not be pointer to const because it is a typedef. */\r
 /*-----------------------------------------------------------*/\r
 \r
 static signed portBASE_TYPE prvIsQueueFull( const xQUEUE *pxQueue )\r
@@ -1589,7 +1664,7 @@ signed portBASE_TYPE xReturn;
        }\r
 \r
        return xReturn;\r
-}\r
+} /*lint !e818 xQueue could not be pointer to const because it is a typedef. */\r
 /*-----------------------------------------------------------*/\r
 \r
 #if ( configUSE_CO_ROUTINES == 1 )\r
@@ -1597,9 +1672,7 @@ signed portBASE_TYPE xReturn;
        signed portBASE_TYPE xQueueCRSend( xQueueHandle xQueue, const void *pvItemToQueue, portTickType xTicksToWait )\r
        {\r
        signed portBASE_TYPE xReturn;\r
-       xQUEUE *pxQueue;\r
-\r
-               pxQueue = ( xQUEUE * ) xQueue;\r
+       xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;\r
 \r
                /* If the queue is already full we may have to block.  A critical section\r
                is required to prevent an interrupt removing something from the queue\r
@@ -1668,9 +1741,7 @@ signed portBASE_TYPE xReturn;
        signed portBASE_TYPE xQueueCRReceive( xQueueHandle xQueue, void *pvBuffer, portTickType xTicksToWait )\r
        {\r
        signed portBASE_TYPE xReturn;\r
-       xQUEUE *pxQueue;\r
-\r
-               pxQueue = ( xQUEUE * ) xQueue;\r
+       xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;\r
 \r
                /* If the queue is already empty we may have to block.  A critical section\r
                is required to prevent an interrupt adding something to the queue\r
@@ -1709,7 +1780,7 @@ signed portBASE_TYPE xReturn;
                                        pxQueue->u.pcReadFrom = pxQueue->pcHead;\r
                                }\r
                                --( pxQueue->uxMessagesWaiting );\r
-                               memcpy( ( void * ) pvBuffer, ( void * ) pxQueue->u.pcReadFrom, ( unsigned ) pxQueue->uxItemSize );\r
+                               ( void ) memcpy( ( void * ) pvBuffer, ( void * ) pxQueue->u.pcReadFrom, ( unsigned ) pxQueue->uxItemSize );\r
 \r
                                xReturn = pdPASS;\r
 \r
@@ -1743,9 +1814,7 @@ signed portBASE_TYPE xReturn;
 \r
        signed portBASE_TYPE xQueueCRSendFromISR( xQueueHandle xQueue, const void *pvItemToQueue, signed portBASE_TYPE xCoRoutinePreviouslyWoken )\r
        {\r
-       xQUEUE *pxQueue;\r
-\r
-               pxQueue = ( xQUEUE * ) xQueue;\r
+       xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;\r
 \r
                /* Cannot block within an ISR so if there is no space on the queue then\r
                exit without doing anything. */\r
@@ -1778,9 +1847,7 @@ signed portBASE_TYPE xReturn;
        signed portBASE_TYPE xQueueCRReceiveFromISR( xQueueHandle xQueue, void *pvBuffer, signed portBASE_TYPE *pxCoRoutineWoken )\r
        {\r
        signed portBASE_TYPE xReturn;\r
-       xQUEUE * pxQueue;\r
-\r
-               pxQueue = ( xQUEUE * ) xQueue;\r
+       xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;\r
 \r
                /* We cannot block from an ISR, so check there is data available. If\r
                not then just leave without doing anything. */\r
@@ -1793,7 +1860,7 @@ signed portBASE_TYPE xReturn;
                                pxQueue->u.pcReadFrom = pxQueue->pcHead;\r
                        }\r
                        --( pxQueue->uxMessagesWaiting );\r
-                       memcpy( ( void * ) pvBuffer, ( void * ) pxQueue->u.pcReadFrom, ( unsigned ) pxQueue->uxItemSize );\r
+                       ( void ) memcpy( ( void * ) pvBuffer, ( void * ) pxQueue->u.pcReadFrom, ( unsigned ) pxQueue->uxItemSize );\r
 \r
                        if( ( *pxCoRoutineWoken ) == pdFALSE )\r
                        {\r
@@ -1860,7 +1927,7 @@ signed portBASE_TYPE xReturn;
                        }\r
                }\r
 \r
-       }\r
+       } /*lint !e818 xQueue could not be pointer to const because it is a typedef. */\r
 \r
 #endif /* configQUEUE_REGISTRY_SIZE */\r
 /*-----------------------------------------------------------*/\r
@@ -1869,9 +1936,7 @@ signed portBASE_TYPE xReturn;
 \r
        void vQueueWaitForMessageRestricted( xQueueHandle xQueue, portTickType xTicksToWait )\r
        {\r
-       xQUEUE *pxQueue;\r
-\r
-               pxQueue = ( xQUEUE * ) xQueue;\r
+       xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;\r
 \r
                /* This function should not be called by application code hence the\r
                'Restricted' in its name.  It is not part of the public API.  It is\r
@@ -1924,7 +1989,7 @@ signed portBASE_TYPE xReturn;
                        /* Cannot add a queue/semaphore to more than one queue set. */\r
                        xReturn = pdFAIL;\r
                }\r
-               else if( ( ( xQUEUE * ) xQueueOrSemaphore )->uxMessagesWaiting != 0 )\r
+               else if( ( ( xQUEUE * ) xQueueOrSemaphore )->uxMessagesWaiting != ( unsigned portBASE_TYPE ) 0 )\r
                {\r
                        /* Cannot add a queue/semaphore to a queue set if there are already\r
                        items in the queue/semaphore. */\r
@@ -1951,16 +2016,14 @@ signed portBASE_TYPE xReturn;
        portBASE_TYPE xQueueRemoveFromSet( xQueueSetMemberHandle xQueueOrSemaphore, xQueueSetHandle xQueueSet )\r
        {\r
        portBASE_TYPE xReturn;\r
-       xQUEUE *pxQueueOrSemaphore;\r
-\r
-               pxQueueOrSemaphore = ( xQUEUE * ) xQueueOrSemaphore;\r
+       xQUEUE * const pxQueueOrSemaphore = ( xQUEUE * ) xQueueOrSemaphore;\r
 \r
                if( pxQueueOrSemaphore->pxQueueSetContainer != xQueueSet )\r
                {\r
                        /* The queue was not a member of the set. */\r
                        xReturn = pdFAIL;\r
                }\r
-               else if( pxQueueOrSemaphore->uxMessagesWaiting != 0 )\r
+               else if( pxQueueOrSemaphore->uxMessagesWaiting != ( unsigned portBASE_TYPE ) 0 )\r
                {\r
                        /* It is dangerous to remove a queue from a set when the queue is\r
                        not empty because the queue set will still hold pending events for\r
@@ -1979,7 +2042,7 @@ signed portBASE_TYPE xReturn;
                }\r
 \r
                return xReturn;\r
-       }\r
+       } /*lint !e818 xQueueSet could not be declared as pointing to const as it is a typedef. */\r
 \r
 #endif /* configUSE_QUEUE_SETS */\r
 /*-----------------------------------------------------------*/\r
@@ -1990,7 +2053,7 @@ signed portBASE_TYPE xReturn;
        {\r
        xQueueSetMemberHandle xReturn = NULL;\r
 \r
-               xQueueGenericReceive( ( xQueueHandle ) xQueueSet, &xReturn, xBlockTimeTicks, pdFALSE );\r
+               ( void ) xQueueGenericReceive( ( xQueueHandle ) xQueueSet, &xReturn, xBlockTimeTicks, pdFALSE ); /*lint !e961 Casting from one typedef to another is not redundant. */\r
                return xReturn;\r
        }\r
 \r
@@ -2003,7 +2066,7 @@ signed portBASE_TYPE xReturn;
        {\r
        xQueueSetMemberHandle xReturn = NULL;\r
 \r
-               xQueueReceiveFromISR( ( xQueueHandle ) xQueueSet, &xReturn, NULL );\r
+               ( void ) xQueueReceiveFromISR( ( xQueueHandle ) xQueueSet, &xReturn, NULL ); /*lint !e961 Casting from one typedef to another is not redundant. */\r
                return xReturn;\r
        }\r
 \r
@@ -2012,7 +2075,7 @@ signed portBASE_TYPE xReturn;
 \r
 #if ( configUSE_QUEUE_SETS == 1 )\r
 \r
-       static portBASE_TYPE prvNotifyQueueSetContainer( xQUEUE *pxQueue, portBASE_TYPE xCopyPosition )\r
+       static portBASE_TYPE prvNotifyQueueSetContainer( const xQUEUE * const pxQueue, portBASE_TYPE xCopyPosition )\r
        {\r
        xQUEUE *pxQueueSetContainer = pxQueue->pxQueueSetContainer;\r
        portBASE_TYPE xReturn = pdFALSE;\r
@@ -2040,3 +2103,14 @@ signed portBASE_TYPE xReturn;
 \r
 #endif /* configUSE_QUEUE_SETS */\r
 \r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r