]> git.sur5r.net Git - freertos/commitdiff
Kernel code:
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Wed, 4 Mar 2015 17:45:18 +0000 (17:45 +0000)
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Wed, 4 Mar 2015 17:45:18 +0000 (17:45 +0000)
+ Added mtCOVERAGE_TEST_DELAY() macro to facilitate getting better code coverage during testing.
+ Update prvNotifyQueueSetContainer() so it does not call xTaskRemoveFromEventList() if it is called from an interrupt, and the queue is locked.

Demo apps:
Added QueueSetPolling.c/h demo/test functions.

git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2331 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

12 files changed:
FreeRTOS/Demo/Common/Minimal/QueueSet.c
FreeRTOS/Demo/Common/Minimal/QueueSetPolling.c [new file with mode: 0644]
FreeRTOS/Demo/Common/include/QueueSetPolling.h [new file with mode: 0644]
FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj
FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj.filters
FreeRTOS/Demo/WIN32-MSVC/main_full.c
FreeRTOS/Source/event_groups.c
FreeRTOS/Source/include/FreeRTOS.h
FreeRTOS/Source/list.c
FreeRTOS/Source/portable/MSVC-MingW/portmacro.h
FreeRTOS/Source/queue.c
FreeRTOS/Source/tasks.c

index 33e3897b9ca08932b8eac309e73cd40fbea08cf9..883e65371863b39aafaecca173fae829c8ecfde4 100644 (file)
@@ -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
diff --git a/FreeRTOS/Demo/Common/Minimal/QueueSetPolling.c b/FreeRTOS/Demo/Common/Minimal/QueueSetPolling.c
new file mode 100644 (file)
index 0000000..4126e24
--- /dev/null
@@ -0,0 +1,217 @@
+/*\r
+    FreeRTOS V8.2.0 - 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
+\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
+\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
+    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.  Full license text is available on the following\r
+    link: http://www.freertos.org/a00114.html\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS provides completely free yet professionally developed,    *\r
+     *    robust, strictly quality controlled, supported, and cross          *\r
+     *    platform software that is more than just the market leader, it     *\r
+     *    is the industry's de facto standard.                               *\r
+     *                                                                       *\r
+     *    Help yourself get started quickly while simultaneously helping     *\r
+     *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
+     *    tutorial book, reference manual, or both:                          *\r
+     *    http://www.FreeRTOS.org/Documentation                              *\r
+     *                                                                       *\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
+\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
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\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.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
+    Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
+    Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
+    licenses offer ticketed support, indemnification and commercial 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
+/*\r
+ * Tests the use of queue sets.\r
+ *\r
+ * A receive task creates a number of queues and adds them to a queue set before\r
+ * blocking on the queue set receive.  A transmit task and (optionally) an\r
+ * interrupt repeatedly unblocks the receive task by sending messages to the\r
+ * queues in a pseudo random order.  The receive task removes the messages from\r
+ * the queues and flags an error if the received message does not match that\r
+ * expected.  The task sends values in the range 0 to\r
+ * queuesetINITIAL_ISR_TX_VALUE, and the ISR sends value in the range\r
+ * queuesetINITIAL_ISR_TX_VALUE to ULONG_MAX.\r
+ */\r
+\r
+\r
+/* Standard includes. */\r
+#include <stdlib.h>\r
+#include <limits.h>\r
+\r
+/* Kernel includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+#include "queue.h"\r
+\r
+/* Demo includes. */\r
+#include "QueueSetPolling.h"\r
+\r
+/* The length of each created queue. */\r
+#define setpollQUEUE_LENGTH    10\r
+\r
+/* Block times used in this demo.  A block time or 0 means "don't block". */\r
+#define setpollDONT_BLOCK 0\r
+\r
+/* The ISR sends to the queue every setpollISR_TX_PERIOD ticks. */\r
+#define queuesetISR_TX_PERIOD  ( 50UL )\r
+\r
+/*\r
+ * The task that reads from the queue set.\r
+ */\r
+static void prvQueueSetReceivingTask( void *pvParameters );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/* The queue that is added to the set. */\r
+static QueueHandle_t xQueue = NULL;\r
+\r
+/* The handle of the queue set to which the queue is added. */\r
+static QueueSetHandle_t xQueueSet = NULL;\r
+\r
+/* Set to pdFAIL if an error is detected by any queue set task.\r
+ulCycleCounter will only be incremented if xQueueSetTasksSatus equals pdPASS. */\r
+static volatile BaseType_t xQueueSetPollStatus = pdPASS;\r
+\r
+/* Counter used to ensure the task is still running. */\r
+static uint32_t ulCycleCounter = 0;\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+void vStartQueueSetPollingTask( void )\r
+{\r
+       /* Create the queue that is added to the set, the set, and add the queue to\r
+       the set. */\r
+       xQueue = xQueueCreate( setpollQUEUE_LENGTH, sizeof( uint32_t ) );\r
+       xQueueSet = xQueueCreateSet( setpollQUEUE_LENGTH );\r
+       xQueueAddToSet( xQueue, xQueueSet );\r
+\r
+       /* Create the task. */\r
+       xTaskCreate( prvQueueSetReceivingTask, "SetPoll", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvQueueSetReceivingTask( void *pvParameters )\r
+{\r
+uint32_t ulReceived, ulExpected = 0;\r
+QueueHandle_t xActivatedQueue;\r
+\r
+       /* Remove compiler warnings. */\r
+       ( void ) pvParameters;\r
+\r
+       for( ;; )\r
+       {\r
+               /* Is a message waiting?  A block time is not used to ensure the queue\r
+               set is polled while it is being written to from an interrupt. */\r
+               xActivatedQueue = xQueueSelectFromSet( xQueueSet, setpollDONT_BLOCK );\r
+\r
+               if( xActivatedQueue != NULL )\r
+               {\r
+                       /* Reading from the queue should pass with a zero block time as\r
+                       this task will only run when something has been posted to a task\r
+                       in the queue set. */\r
+                       if( xQueueReceive( xActivatedQueue, &ulReceived, setpollDONT_BLOCK ) != pdPASS )\r
+                       {\r
+                               xQueueSetPollStatus = pdFAIL;\r
+                       }\r
+\r
+                       if( ulReceived == ulExpected )\r
+                       {\r
+                               ulExpected++;\r
+                       }\r
+                       else\r
+                       {\r
+                               xQueueSetPollStatus = pdFAIL;\r
+                       }\r
+\r
+                       if( xQueueSetPollStatus == pdPASS )\r
+                       {\r
+                               ulCycleCounter++;\r
+                       }\r
+               }\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vQueueSetPollingInterruptAccess( void )\r
+{\r
+static uint32_t ulCallCount = 0, ulValueToSend = 0;\r
+\r
+       /* It is intended that this function is called from the tick hook\r
+       function, so each call is one tick period apart. */\r
+       ulCallCount++;\r
+       if( ulCallCount > queuesetISR_TX_PERIOD )\r
+       {\r
+               ulCallCount = 0;\r
+\r
+               if( xQueueSendFromISR( xQueue, ( void * ) &ulValueToSend, NULL ) == pdPASS )\r
+               {\r
+                       /* Send the next value next time. */\r
+                       ulValueToSend++;\r
+               }\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+BaseType_t xAreQueueSetPollTasksStillRunning( void )\r
+{\r
+static uint32_t ulLastCycleCounter = 0;\r
+\r
+       if( ulLastCycleCounter == ulCycleCounter )\r
+       {\r
+               xQueueSetPollStatus = pdFAIL;\r
+       }\r
+\r
+       ulLastCycleCounter = ulCycleCounter;\r
+\r
+       return xQueueSetPollStatus;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+\r
diff --git a/FreeRTOS/Demo/Common/include/QueueSetPolling.h b/FreeRTOS/Demo/Common/include/QueueSetPolling.h
new file mode 100644 (file)
index 0000000..315f6cf
--- /dev/null
@@ -0,0 +1,79 @@
+/*\r
+    FreeRTOS V8.2.0 - 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
+\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
+\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
+    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.  Full license text is available on the following\r
+    link: http://www.freertos.org/a00114.html\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS provides completely free yet professionally developed,    *\r
+     *    robust, strictly quality controlled, supported, and cross          *\r
+     *    platform software that is more than just the market leader, it     *\r
+     *    is the industry's de facto standard.                               *\r
+     *                                                                       *\r
+     *    Help yourself get started quickly while simultaneously helping     *\r
+     *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
+     *    tutorial book, reference manual, or both:                          *\r
+     *    http://www.FreeRTOS.org/Documentation                              *\r
+     *                                                                       *\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
+\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
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\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.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
+    Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
+    Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
+    licenses offer ticketed support, indemnification and commercial 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
+#ifndef QUEUE_SET_POLLING_H\r
+#define QUEUE_SET_POLLING_H\r
+\r
+void vStartQueueSetPollingTask( void );\r
+BaseType_t xAreQueueSetPollTasksStillRunning( void );\r
+void vQueueSetPollingInterruptAccess( void );\r
+\r
+#endif /* QUEUE_SET_POLLING_H */\r
+\r
+\r
index 39234651c17bd4290cafb6a1e127cb67071a8b63..e0a04cabd49fc2bd0d0294f8652e9c3fb637548f 100644 (file)
     <ClCompile Include="..\Common\Minimal\QPeek.c" />\r
     <ClCompile Include="..\Common\Minimal\QueueOverwrite.c" />\r
     <ClCompile Include="..\Common\Minimal\QueueSet.c" />\r
+    <ClCompile Include="..\Common\Minimal\QueueSetPolling.c" />\r
     <ClCompile Include="..\Common\Minimal\semtest.c" />\r
     <ClCompile Include="..\Common\Minimal\TaskNotify.c" />\r
     <ClCompile Include="..\Common\Minimal\timerdemo.c" />\r
index d4e210a8d12fc01917c3ce1acfe3b60b5de75ffd..b7be92210f32490dd95b7cf522249ed2f51ac3d2 100644 (file)
     <ClCompile Include="..\Common\Minimal\TaskNotify.c">\r
       <Filter>Demo App Source\Common Demo Tasks</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\Common\Minimal\QueueSetPolling.c">\r
+      <Filter>Demo App Source\Common Demo Tasks</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="FreeRTOSConfig.h">\r
index 3f7e0920e3297d0c5415cfe087ebc1ab2d123203..db89451a4670b28c49bc58ae226fb5b08522a51a 100644 (file)
 #include "EventGroupsDemo.h"\r
 #include "IntSemTest.h"\r
 #include "TaskNotify.h"\r
+#include "QueueSetPolling.h"\r
 \r
 /* Priorities at which the tasks are created. */\r
 #define mainCHECK_TASK_PRIORITY                        ( configMAX_PRIORITIES - 2 )\r
@@ -214,9 +215,10 @@ int main_full( void )
        vStartDynamicPriorityTasks();\r
        vStartQueueSetTasks();\r
        vStartQueueOverwriteTask( mainQUEUE_OVERWRITE_PRIORITY );\r
-       xTaskCreate( prvDemoQueueSpaceFunctions, "QSpace", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
        vStartEventGroupTasks();\r
        vStartInterruptSemaphoreTasks();\r
+       vStartQueueSetPollingTask();\r
+       xTaskCreate( prvDemoQueueSpaceFunctions, "QSpace", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
 \r
        #if( configUSE_PREEMPTION != 0  )\r
        {\r
@@ -336,6 +338,10 @@ const TickType_t xCycleFrequency = 2500 / portTICK_PERIOD_MS;
                {\r
                        pcStatusMessage = "Error: Queue overwrite";\r
                }\r
+               else if( xAreQueueSetPollTasksStillRunning() != pdPASS )\r
+               {\r
+                       pcStatusMessage = "Error: Queue set polling";\r
+               }\r
 \r
                /* This is the only task that uses stdout so its ok to call printf()\r
                directly. */\r
@@ -417,6 +423,7 @@ TaskHandle_t xTimerTask;
        /* Write to a queue that is in use as part of the queue set demo to\r
        demonstrate using queue sets from an ISR. */\r
        vQueueSetAccessQueueSetFromISR();\r
+       vQueueSetPollingInterruptAccess();\r
 \r
        /* Exercise event groups from interrupts. */\r
        vPeriodicEventGroupsProcessing();\r
index ebac26884a502f70d55460ab0b55927d020a4ca6..85dd487aab7ac6a34a969007158d220473163d29 100644 (file)
@@ -139,7 +139,7 @@ EventGroupHandle_t xEventGroupCreate( void )
 {\r
 EventGroup_t *pxEventBits;\r
 \r
-       pxEventBits = pvPortMalloc( sizeof( EventGroup_t ) );\r
+       pxEventBits = ( EventGroup_t * ) pvPortMalloc( sizeof( EventGroup_t ) );\r
        if( pxEventBits != NULL )\r
        {\r
                pxEventBits->uxEventBits = 0;\r
index a149c96d68a5772c57a7261677e8a9882c9f53f2..55be506acfd871bed36680f09639c947c5b3dfa2 100644 (file)
@@ -719,6 +719,10 @@ extern "C" {
        #define mtCOVERAGE_TEST_MARKER()\r
 #endif\r
 \r
+#ifndef mtCOVERAGE_TEST_DELAY\r
+       #define mtCOVERAGE_TEST_DELAY()\r
+#endif\r
+\r
 #ifndef portASSERT_IF_IN_ISR\r
        #define portASSERT_IF_IN_ISR()\r
 #endif\r
index cd273ad828da1503a14fd787c837e447367734a1..ecc2c2b887d27e1afb1f23a5c93544f1c5ab5239 100644 (file)
@@ -128,6 +128,10 @@ ListItem_t * const pxIndex = pxList->pxIndex;
        listGET_OWNER_OF_NEXT_ENTRY(). */\r
        pxNewListItem->pxNext = pxIndex;\r
        pxNewListItem->pxPrevious = pxIndex->pxPrevious;\r
+\r
+       /* Only used during decision coverage testing. */\r
+       mtCOVERAGE_TEST_DELAY();\r
+\r
        pxIndex->pxPrevious->pxNext = pxNewListItem;\r
        pxIndex->pxPrevious = pxNewListItem;\r
 \r
@@ -214,6 +218,9 @@ List_t * const pxList = ( List_t * ) pxItemToRemove->pvContainer;
        pxItemToRemove->pxNext->pxPrevious = pxItemToRemove->pxPrevious;\r
        pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext;\r
 \r
+       /* Only used during decision coverage testing. */\r
+       mtCOVERAGE_TEST_DELAY();\r
+\r
        /* Make sure the index is left pointing to a valid item. */\r
        if( pxList->pxIndex == pxItemToRemove )\r
        {\r
index 7f6548193e6391135a32bba5a8dce39abb5e5957..c0a287558ced4e9c39c3ebfab50fd1af546c7b50 100644 (file)
@@ -115,6 +115,10 @@ typedef unsigned long UBaseType_t;
 \r
 #define portYIELD()                                    vPortGenerateSimulatedInterrupt( portINTERRUPT_YIELD )\r
 \r
+/* Simulated interrupts return pdFALSE if no context switch should be performed,\r
+or a non-zero number if a context switch should be performed. */\r
+#define portYIELD_FROM_ISR( x ) return x\r
+\r
 void vPortCloseRunningThread( void *pvTaskToDelete, volatile BaseType_t *pxPendYield );\r
 void vPortDeleteThread( void *pvThreadToDelete );\r
 #define portCLEAN_UP_TCB( pxTCB )      vPortDeleteThread( pxTCB )\r
index 27d3edd6a011472df1e39c6b2e74b8377eaaab51..b26f6dac7638c49a1f2069457fb3a4222a545783 100644 (file)
@@ -2565,12 +2565,19 @@ BaseType_t xReturn;
                        /* 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
+                       if( pxQueueSetContainer->xTxLock == queueUNLOCKED )\r
                        {\r
-                               if( xTaskRemoveFromEventList( &( pxQueueSetContainer->xTasksWaitingToReceive ) ) != pdFALSE )\r
+                               if( listLIST_IS_EMPTY( &( pxQueueSetContainer->xTasksWaitingToReceive ) ) == pdFALSE )\r
                                {\r
-                                       /* The task waiting has a higher priority */\r
-                                       xReturn = pdTRUE;\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
@@ -2579,7 +2586,7 @@ BaseType_t xReturn;
                        }\r
                        else\r
                        {\r
-                               mtCOVERAGE_TEST_MARKER();\r
+                               ( pxQueueSetContainer->xTxLock )++;\r
                        }\r
                }\r
                else\r
index c7b29382d97b54935a93b866fafe37374e77daf1..822338df1d1f4117fbaf5ed50b15fc1d2ac4cfde 100644 (file)
@@ -3321,9 +3321,8 @@ TCB_t *pxTCB;
 \r
        if( listLIST_IS_EMPTY( pxDelayedTaskList ) != pdFALSE )\r
        {\r
-               /* The new current delayed list is empty.  Set\r
-               xNextTaskUnblockTime to the maximum possible value so it is\r
-               extremely unlikely that the\r
+               /* The new current delayed list is empty.  Set xNextTaskUnblockTime to\r
+               the maximum possible value so it is     extremely unlikely that the\r
                if( xTickCount >= xNextTaskUnblockTime ) test will pass until\r
                there is an item in the delayed list. */\r
                xNextTaskUnblockTime = portMAX_DELAY;\r