]> git.sur5r.net Git - freertos/commitdiff
Fix a few compiler warnings when compiling the QueueSet.c test code with GCC.
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Fri, 8 Feb 2013 17:05:42 +0000 (17:05 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Fri, 8 Feb 2013 17:05:42 +0000 (17:05 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1820 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/main.c
FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/main_blinky.c
FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/main_full.c
FreeRTOS/Demo/Common/Minimal/QueueSet.c
FreeRTOS/Source/queue.c

index 80b0400bc6b0211874cb60b9922e2aed4edc2cc8..f1c8cfec3847983d7bb19247f3f3de8f748c3ee5 100644 (file)
@@ -86,9 +86,9 @@
 #include "FreeRTOS.h"\r
 #include "task.h"\r
 \r
-/* Standard demo includes - just needed for the LED (ParTest) initialisation\r
-function. */\r
+/* Standard demo includes. */\r
 #include "partest.h"\r
+#include "QueueSet.h"\r
 \r
 /* Atmel library includes. */\r
 #include <asf.h>\r
@@ -200,3 +200,20 @@ void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName
 }\r
 /*-----------------------------------------------------------*/\r
 \r
+void vApplicationTickHook( void )\r
+{\r
+       /* This function will be called by each tick interrupt if\r
+       configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h.  User code can be\r
+       added here, but the tick hook is called from an interrupt context, so\r
+       code must not attempt to block, and only the interrupt safe FreeRTOS API\r
+       functions can be used (those that end in FromISR()).  */\r
+\r
+       #if ( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 0 )\r
+       {\r
+               /* In this case the tick hook is used as part of the queue set test. */\r
+               vQueueSetWriteToQueueFromISR();\r
+       }\r
+       #endif /* mainCREATE_SIMPLE_BLINKY_DEMO_ONLY */\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
index 1ea633724f5f36df9336c17254037345d434f303..e165eb493ea0411ee751211b3aac9503d4b52e2f 100644 (file)
@@ -240,13 +240,3 @@ unsigned long ulReceivedValue;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-void vApplicationTickHook( void )\r
-{\r
-       /* This function will be called by each tick interrupt if\r
-       configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h.  User code can be\r
-       added here, but the tick hook is called from an interrupt context, so\r
-       code must not attempt to block, and only the interrupt safe FreeRTOS API\r
-       functions can be used (those that end in FromISR()). */\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
index 84cae55e624e25ca59234dab796555516a65b080..d49469b7bc3636a016546dd776fdc66601cd079e 100644 (file)
@@ -314,15 +314,3 @@ unsigned long ulErrorFound = pdFALSE;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-void vApplicationTickHook( void )\r
-{\r
-       /* This function will be called by each tick interrupt if\r
-       configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h.  User code can be\r
-       added here, but the tick hook is called from an interrupt context, so\r
-       code must not attempt to block, and only the interrupt safe FreeRTOS API\r
-       functions can be used (those that end in FromISR()).  In this case the tick\r
-       hook is used as part of the queue set test. */\r
-       vQueueSetWriteToQueueFromISR();\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
index 15a1e6b36499394d04cd7378481fb9572e7eae1e..809aff1ed416147fa9f666685eb48a046abdc38e 100644 (file)
  * queuesetINITIAL_ISR_TX_VALUE to 0xffffffffUL;\r
  */\r
 \r
+/* Standard includes. */\r
+#include <stdlib.h>\r
+\r
 /* Kernel includes. */\r
-#include <FreeRTOS.h>\r
+#include "FreeRTOS.h"\r
 #include "task.h"\r
 #include "queue.h"\r
 \r
@@ -245,7 +248,7 @@ static unsigned long ulCallCount = 0;
                                if( xQueues[ x ] != NULL )\r
                                {\r
                                        /* xQueues[ x ] can be written to.  Send the next value. */\r
-                                       if( xQueueSendFromISR( xQueues[ x ], &ulISRTxValue, NULL ) == pdPASS )\r
+                                       if( xQueueSendFromISR( xQueues[ x ], ( void * ) &ulISRTxValue, NULL ) == pdPASS )\r
                                        {\r
                                                ulISRTxValue++;\r
 \r
index 5d6b5aec23919a266c865eee85bcb897b88f8535..2cc676cf73644b55cfa42778491ec0d5c489df67 100644 (file)
@@ -1385,6 +1385,18 @@ static void prvUnlockQueue( xQueueHandle pxQueue )
                                {\r
                                        #if ( configUSE_QUEUE_SETS == 1 )\r
                                        {\r
+                                               /* It is highly unlikely that this code will ever run,\r
+                                               for the following reason:\r
+                                                 + A task will only lock a queue that is part of a\r
+                                                   queue set when it is blocking on a write to the\r
+                                                       queue.\r
+                                                 + An interrupt can only add something to a queue\r
+                                                   while the queue is locked (resulting in the\r
+                                                       following code executing when the queue is unlocked)\r
+                                                       if the queue is not full, meaning a task will never\r
+                                                       have blocked on a write in the first place.\r
+                                                The code could execute if an interrupt is also removing\r
+                                                items from a queue. */\r
                                                if( pxQueue->pxQueueSetContainer != NULL )\r
                                                {\r
                                                        if( prvNotifyQueueSetContainer( pxQueue, queueSEND_TO_BACK ) == pdTRUE )\r