+#endif /* configUSE_TIMERS */\r
+/*-----------------------------------------------------------*/\r
+\r
+#if ( configUSE_QUEUE_SETS == 1 )\r
+\r
+ QueueSetHandle_t xQueueCreateSet( const UBaseType_t uxEventQueueLength )\r
+ {\r
+ QueueSetHandle_t pxQueue;\r
+\r
+ pxQueue = xQueueGenericCreate( uxEventQueueLength, sizeof( Queue_t * ), queueQUEUE_TYPE_SET );\r
+\r
+ return pxQueue;\r
+ }\r
+\r
+#endif /* configUSE_QUEUE_SETS */\r
+/*-----------------------------------------------------------*/\r
+\r
+#if ( configUSE_QUEUE_SETS == 1 )\r
+\r
+ BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet )\r
+ {\r
+ BaseType_t xReturn;\r
+\r
+ taskENTER_CRITICAL();\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
+ {\r
+ ( ( Queue_t * ) xQueueOrSemaphore )->pxQueueSetContainer = xQueueSet;\r
+ xReturn = pdPASS;\r
+ }\r
+ }\r
+ taskEXIT_CRITICAL();\r
+\r
+ return xReturn;\r
+ }\r
+\r
+#endif /* configUSE_QUEUE_SETS */\r
+/*-----------------------------------------------------------*/\r
+\r
+#if ( configUSE_QUEUE_SETS == 1 )\r
+\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( pxQueueOrSemaphore->pxQueueSetContainer != xQueueSet )\r
+ {\r
+ /* The queue was not a member of the set. */\r
+ xReturn = pdFAIL;\r
+ }\r
+ else if( pxQueueOrSemaphore->uxMessagesWaiting != ( UBaseType_t ) 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
+ the queue. */\r
+ xReturn = pdFAIL;\r
+ }\r
+ else\r
+ {\r
+ taskENTER_CRITICAL();\r
+ {\r
+ /* The queue is no longer contained in the set. */\r
+ pxQueueOrSemaphore->pxQueueSetContainer = NULL;\r
+ }\r
+ taskEXIT_CRITICAL();\r
+ xReturn = pdPASS;\r
+ }\r
+\r
+ return xReturn;\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
+\r
+#if ( configUSE_QUEUE_SETS == 1 )\r
+\r
+ QueueSetMemberHandle_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet, TickType_t const xTicksToWait )\r
+ {\r
+ QueueSetMemberHandle_t xReturn = NULL;\r
+\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
+#endif /* configUSE_QUEUE_SETS */\r
+/*-----------------------------------------------------------*/\r
+\r
+#if ( configUSE_QUEUE_SETS == 1 )\r
+\r
+ QueueSetMemberHandle_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet )\r
+ {\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
+ }\r
+\r
+#endif /* configUSE_QUEUE_SETS */\r
+/*-----------------------------------------------------------*/\r
+\r
+#if ( configUSE_QUEUE_SETS == 1 )\r
+\r
+ static BaseType_t prvNotifyQueueSetContainer( const Queue_t * const pxQueue, const BaseType_t xCopyPosition )\r
+ {\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
+ if( pxQueueSetContainer->uxMessagesWaiting < pxQueueSetContainer->uxLength )\r
+ {\r
+ traceQUEUE_SEND( pxQueueSetContainer );\r
+ /* The data copied is the handle of the queue that contains data. */\r
+ xReturn = prvCopyDataToQueue( pxQueueSetContainer, &pxQueue, xCopyPosition );\r
+\r
+ if( listLIST_IS_EMPTY( &( pxQueueSetContainer->xTasksWaitingToReceive ) ) == pdFALSE )\r
+ {\r
+ if( xTaskRemoveFromEventList( &( pxQueueSetContainer->xTasksWaitingToReceive ) ) != pdFALSE )\r
+ {\r
+ /* The task waiting has a higher priority */\r
+ xReturn = pdTRUE;\r
+ }\r
+ else\r
+ {\r
+ mtCOVERAGE_TEST_MARKER();\r
+ }\r
+ }\r
+ else\r
+ {\r
+ mtCOVERAGE_TEST_MARKER();\r
+ }\r
+ }\r
+ else\r
+ {\r
+ mtCOVERAGE_TEST_MARKER();\r
+ }\r
+\r
+ return xReturn;\r
+ }\r
+\r
+#endif /* configUSE_QUEUE_SETS */\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r