]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/Common/Minimal/QueueSet.c
Update version number ready for the V8.2.3 release.
[freertos] / FreeRTOS / Demo / Common / Minimal / QueueSet.c
index 33e3897b9ca08932b8eac309e73cd40fbea08cf9..4c17fa5ca89452d6fc59de307d48f6729a0ed7d6 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd.\r
+    FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd.\r
     All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
@@ -8,14 +8,14 @@
 \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
-       ***************************************************************************\r
+    ***************************************************************************\r
     >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
     >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
     >>!   obliged to provide the source code for proprietary components     !<<\r
     >>!   outside of the FreeRTOS kernel.                                   !<<\r
-       ***************************************************************************\r
+    ***************************************************************************\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
     ***************************************************************************\r
 \r
     http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
-       the FAQ page "My application does not run, what could be wrong?".  Have you\r
-       defined configASSERT()?\r
+    the FAQ page "My application does not run, what could be wrong?".  Have you\r
+    defined configASSERT()?\r
 \r
-       http://www.FreeRTOS.org/support - In return for receiving this top quality\r
-       embedded software for free we request you assist our global community by\r
-       participating in the support forum.\r
+    http://www.FreeRTOS.org/support - In return for receiving this top quality\r
+    embedded software for free we request you assist our global community by\r
+    participating in the support forum.\r
 \r
-       http://www.FreeRTOS.org/training - Investing in training allows your team to\r
-       be as productive as possible as early as possible.  Now you can receive\r
-       FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
-       Ltd, and the world's leading authority on the world's leading RTOS.\r
+    http://www.FreeRTOS.org/training - Investing in training allows your team to\r
+    be as productive as possible as early as possible.  Now you can receive\r
+    FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
+    Ltd, and the world's leading authority on the world's leading RTOS.\r
 \r
     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
     including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
@@ -395,6 +395,7 @@ static void prvQueueSetReceivingTask( void *pvParameters )
 {\r
 uint32_t ulReceived;\r
 QueueHandle_t xActivatedQueue;\r
+TickType_t xBlockTime;\r
 \r
        /* Remove compiler warnings. */\r
        ( void ) pvParameters;\r
@@ -405,14 +406,28 @@ QueueHandle_t xActivatedQueue;
 \r
        for( ;; )\r
        {\r
+               /* For test coverage reasons, the block time is dependent on the\r
+               priority of this task - which changes during the test.  When the task\r
+               is at the idle priority it polls the queue set. */\r
+               if( uxTaskPriorityGet( NULL ) == tskIDLE_PRIORITY )\r
+               {\r
+                       xBlockTime = 0;\r
+               }\r
+               else\r
+               {\r
+                       xBlockTime = portMAX_DELAY;\r
+               }\r
+\r
                /* Wait for a message to arrive on one of the queues in the set. */\r
-               xActivatedQueue = xQueueSelectFromSet( xQueueSet, portMAX_DELAY );\r
-               configASSERT( xActivatedQueue );\r
+               xActivatedQueue = xQueueSelectFromSet( xQueueSet, portMAX_DELAY );              \r
 \r
                if( xActivatedQueue == NULL )\r
                {\r
-                       /* This should not happen as an infinite delay was used. */\r
-                       xQueueSetTasksStatus = pdFAIL;\r
+                       if( xBlockTime != 0 )\r
+                       {\r
+                               /* This should not happen as an infinite delay was used. */\r
+                               xQueueSetTasksStatus = pdFAIL;\r
+                       }\r
                }\r
                else\r
                {\r
@@ -432,11 +447,11 @@ QueueHandle_t xActivatedQueue;
                                prvCheckReceivedValue( ulReceived );\r
                        }\r
                        taskEXIT_CRITICAL();\r
-               }\r
 \r
-               if( xQueueSetTasksStatus == pdPASS )\r
-               {\r
-                       ulCycleCounter++;\r
+                       if( xQueueSetTasksStatus == pdPASS )\r
+                       {\r
+                               ulCycleCounter++;\r
+                       }\r
                }\r
        }\r
 }\r
@@ -604,8 +619,7 @@ static BaseType_t xQueueToWriteTo = 0;
        {\r
                ulISRTxValue++;\r
 \r
-               /* If the Tx value has wrapped then set it back to its\r
-               initial value. */\r
+               /* If the Tx value has wrapped then set it back to its initial value. */\r
                if( ulISRTxValue == 0UL )\r
                {\r
                        ulISRTxValue = queuesetINITIAL_ISR_TX_VALUE;\r