]> git.sur5r.net Git - freertos/blobdiff - Source/queue.c
Update version numbers to V4.8.0
[freertos] / Source / queue.c
index 46f102860227196babcd9200ac6401e1dbf5ef9a..5b9cf69e335455ea68629dd4ac9a9b2788a5e4cf 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-       FreeRTOS.org V4.7.2 - Copyright (C) 2003-2008 Richard Barry.\r
+       FreeRTOS.org V4.8.0 - Copyright (C) 2003-2008 Richard Barry.\r
 \r
        This file is part of the FreeRTOS.org distribution.\r
 \r
        of http://www.FreeRTOS.org for full details of how and when the exception\r
        can be applied.\r
 \r
+       ***************************************************************************\r
+       ***************************************************************************\r
+       *                                                                                                                                                 *\r
+       * SAVE TIME AND MONEY!  Why not get us to quote to get FreeRTOS.org               *\r
+       * running on your hardware - or even write all or part of your application*\r
+       * for you?  See http://www.OpenRTOS.com for details.                                      *\r
+       *                                                                                                                                                 *\r
+       ***************************************************************************\r
        ***************************************************************************\r
 \r
-       Please ensure to read the configuration and relevant port sections of the \r
+       Please ensure to read the configuration and relevant port sections of the\r
        online documentation.\r
 \r
-       +++ http://www.FreeRTOS.org +++\r
-       Documentation, latest information, license and contact details.  \r
-\r
-       +++ http://www.SafeRTOS.com +++\r
-       A version that is certified for use in safety critical systems.\r
+       http://www.FreeRTOS.org - Documentation, latest information, license and \r
+       contact details.\r
 \r
-       +++ http://www.OpenRTOS.com +++\r
-       Commercial support, development, porting, licensing and training services.\r
+       http://www.SafeRTOS.com - A version that is certified for use in safety \r
+       critical systems.\r
 \r
-       ***************************************************************************\r
+       http://www.OpenRTOS.com - Commercial support, development, porting, \r
+       licensing and training services.\r
 */\r
 \r
 #include <stdlib.h>\r
@@ -107,7 +113,7 @@ typedef xQUEUE * xQueueHandle;
  */\r
 xQueueHandle xQueueCreate( unsigned portBASE_TYPE uxQueueLength, unsigned portBASE_TYPE uxItemSize );\r
 signed portBASE_TYPE xQueueGenericSend( xQueueHandle xQueue, const void * const pvItemToQueue, portTickType xTicksToWait, portBASE_TYPE xCopyPosition );\r
-unsigned portBASE_TYPE uxQueueMessagesWaiting( const xQueueHandle pxQueue );\r
+unsigned portBASE_TYPE uxQueueMessagesWaiting( const xQueueHandle const pxQueue );\r
 void vQueueDelete( xQueueHandle xQueue );\r
 signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle pxQueue, const void * const pvItemToQueue, signed portBASE_TYPE xTaskPreviouslyWoken, portBASE_TYPE xCopyPosition );\r
 signed portBASE_TYPE xQueueGenericReceive( xQueueHandle pxQueue, const void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeeking );\r
@@ -118,9 +124,9 @@ portBASE_TYPE xQueueTakeMutexRecursive( xQueueHandle xMutex, portTickType xBlock
 portBASE_TYPE xQueueGiveMutexRecursive( xQueueHandle xMutex );\r
 signed portBASE_TYPE xQueueAltGenericSend( xQueueHandle pxQueue, const void * const pvItemToQueue, portTickType xTicksToWait, portBASE_TYPE xCopyPosition );\r
 signed portBASE_TYPE xQueueAltGenericReceive( xQueueHandle pxQueue, const void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeeking );\r
-portBASE_TYPE xQueueIsQueueEmptyFromISR( const xQueueHandle pxQueue );\r
-portBASE_TYPE xQueueIsQueueFullFromISR( const xQueueHandle pxQueue );\r
-portBASE_TYPE xQueueMessagesWaitingFromISR( const xQueueHandle pxQueue );\r
+portBASE_TYPE xQueueIsQueueEmptyFromISR( const xQueueHandle const pxQueue );\r
+portBASE_TYPE xQueueIsQueueFullFromISR( const xQueueHandle const pxQueue );\r
+unsigned portBASE_TYPE uxQueueMessagesWaitingFromISR( const xQueueHandle const pxQueue );\r
 \r
 \r
 #if configUSE_CO_ROUTINES == 1\r
@@ -145,14 +151,14 @@ static void prvUnlockQueue( xQueueHandle pxQueue );
  *\r
  * @return pdTRUE if the queue contains no items, otherwise pdFALSE.\r
  */\r
-static signed portBASE_TYPE prvIsQueueEmpty( const xQueueHandle pxQueue );\r
+static signed portBASE_TYPE prvIsQueueEmpty( const xQueueHandle const pxQueue );\r
 \r
 /*\r
  * Uses a critical section to determine if there is any space in a queue.\r
  *\r
  * @return pdTRUE if there is no space, otherwise pdFALSE;\r
  */\r
-static signed portBASE_TYPE prvIsQueueFull( const xQueueHandle pxQueue );\r
+static signed portBASE_TYPE prvIsQueueFull( const xQueueHandle const pxQueue );\r
 \r
 /*\r
  * Copies an item into the queue, either at the front of the queue or the\r
@@ -289,7 +295,7 @@ size_t xQueueSizeInBytes;
        {\r
        portBASE_TYPE xReturn;\r
 \r
-               /* If this is the task that holds the mutex then pxMutexHolder will not \r
+               /* If this is the task that holds the mutex then pxMutexHolder will not\r
                change outside of this task.  If this task does not hold the mutex then\r
                pxMutexHolder can never coincidentally equal the tasks handle, and as\r
                this is the only condition we are interested in it does not matter if\r
@@ -298,7 +304,7 @@ size_t xQueueSizeInBytes;
                if( pxMutex->pxMutexHolder == xTaskGetCurrentTaskHandle() )\r
                {\r
                        /* uxRecursiveCallCount cannot be zero if pxMutexHolder is equal to\r
-                       the task handle, therefore no underflow check is required.  Also, \r
+                       the task handle, therefore no underflow check is required.  Also,\r
                        uxRecursiveCallCount is only modified by the mutex holder, and as\r
                        there can only be one, no mutual exclusion is required to modify the\r
                        uxRecursiveCallCount member. */\r
@@ -336,7 +342,7 @@ size_t xQueueSizeInBytes;
        {\r
        portBASE_TYPE xReturn;\r
 \r
-               /* Comments regarding mutual exclusion as per those within \r
+               /* Comments regarding mutual exclusion as per those within\r
                xQueueGiveMutexRecursive(). */\r
 \r
                if( pxMutex->pxMutexHolder == xTaskGetCurrentTaskHandle() )\r
@@ -406,7 +412,7 @@ xTimeOutType xTimeOut;
                        if( xReturn == pdTRUE )\r
                        {\r
                                /* This is the first time through - we need to capture the\r
-                               time while the scheduler is locked to ensure we attempt to \r
+                               time while the scheduler is locked to ensure we attempt to\r
                                block at least once. */\r
                                vTaskSetTimeOutState( &xTimeOut );\r
                        }\r
@@ -422,10 +428,10 @@ xTimeOutType xTimeOut;
                                        vTaskPlaceOnEventList( &( pxQueue->xTasksWaitingToSend ), xTicksToWait );\r
                                                \r
                                        /* Unlocking the queue means queue events can effect the\r
-                                       event list.  It is possible     that interrupts occurring now \r
+                                       event list.  It is possible     that interrupts occurring now\r
                                        remove this task from the event list again - but as the\r
                                        scheduler is suspended the task will go onto the pending\r
-                                       ready last instead of the actual ready list. */ \r
+                                       ready last instead of the actual ready list. */\r
                                        prvUnlockQueue( pxQueue );\r
                                                \r
                                        /* Resuming the scheduler will move tasks from the pending\r
@@ -453,7 +459,7 @@ xTimeOutType xTimeOut;
                        }\r
                }\r
                        \r
-               /* Higher priority tasks and interrupts can execute during \r
+               /* Higher priority tasks and interrupts can execute during\r
                this time and could possible refill the queue - even if we\r
                unblocked because space became available. */\r
                \r
@@ -493,7 +499,7 @@ xTimeOutType xTimeOut;
 \r
                if( xReturn == errQUEUE_FULL )\r
                {\r
-                       if( xTicksToWait > 0 )\r
+                       if( xTicksToWait > ( portTickType ) 0 )\r
                        {\r
                                if( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE )\r
                                {\r
@@ -525,9 +531,9 @@ xTimeOutType xTimeOut;
 \r
                /* The source code that implements the alternative (Alt) API is\r
                simpler because it makes more use of critical sections.  This is        \r
-               the approach taken by many other RTOSes, but FreeRTOS.org has the \r
-               preferred fully featured API too.  The fully featured API has more \r
-               complex code that takes longer to execute, but makes less use of \r
+               the approach taken by many other RTOSes, but FreeRTOS.org has the\r
+               preferred fully featured API too.  The fully featured API has more\r
+               complex code that takes longer to execute, but makes less use of\r
                critical sections.  */\r
 \r
                do\r
@@ -541,7 +547,7 @@ xTimeOutType xTimeOut;
                                        if( xReturn == pdPASS )\r
                                        {\r
                                                /* This is the first time through - capture the time\r
-                                               inside the critical section to ensure we attempt to \r
+                                               inside the critical section to ensure we attempt to\r
                                                block at least once. */\r
                                                vTaskSetTimeOutState( &xTimeOut );\r
                                        }\r
@@ -565,7 +571,7 @@ xTimeOutType xTimeOut;
                                portEXIT_CRITICAL();\r
                        }\r
                                \r
-                       /* Higher priority tasks and interrupts can execute during \r
+                       /* Higher priority tasks and interrupts can execute during\r
                        this time and could possible refill the queue - even if we\r
                        unblocked because space became available. */\r
                        \r
@@ -605,7 +611,7 @@ xTimeOutType xTimeOut;
 \r
                        if( xReturn == errQUEUE_FULL )\r
                        {\r
-                               if( xTicksToWait > 0 )\r
+                               if( xTicksToWait > ( portTickType ) 0 )\r
                                {\r
                                        if( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE )\r
                                        {\r
@@ -640,9 +646,9 @@ xTimeOutType xTimeOut;
 \r
                /* The source code that implements the alternative (Alt) API is\r
                simpler because it makes more use of critical sections.  This is        \r
-               the approach taken by many other RTOSes, but FreeRTOS.org has the \r
-               preferred fully featured API too.  The fully featured API has more \r
-               complex code that takes longer to execute, but makes less use of \r
+               the approach taken by many other RTOSes, but FreeRTOS.org has the\r
+               preferred fully featured API too.  The fully featured API has more\r
+               complex code that takes longer to execute, but makes less use of\r
                critical sections.  */\r
 \r
                do\r
@@ -655,7 +661,7 @@ xTimeOutType xTimeOut;
                                        if( xReturn == pdPASS )\r
                                        {\r
                                                /* This is the first time through - capture the time\r
-                                               inside the critical section to ensure we attempt to \r
+                                               inside the critical section to ensure we attempt to\r
                                                block at least once. */\r
                                                vTaskSetTimeOutState( &xTimeOut );\r
                                        }\r
@@ -757,7 +763,7 @@ xTimeOutType xTimeOut;
 \r
                        if( xReturn == errQUEUE_EMPTY )\r
                        {\r
-                               if( xTicksToWait > 0 )\r
+                               if( xTicksToWait > ( portTickType ) 0 )\r
                                {\r
                                        if( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE )\r
                                        {\r
@@ -847,7 +853,7 @@ signed portCHAR *pcOriginalReadPosition;
                        if( xReturn == pdTRUE )\r
                        {\r
                                /* This is the first time through - we need to capture the\r
-                               time while the scheduler is locked to ensure we attempt to \r
+                               time while the scheduler is locked to ensure we attempt to\r
                                block at least once. */\r
                                vTaskSetTimeOutState( &xTimeOut );\r
                        }\r
@@ -1034,7 +1040,7 @@ signed portBASE_TYPE xReturn;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-unsigned portBASE_TYPE uxQueueMessagesWaiting( const xQueueHandle pxQueue )\r
+unsigned portBASE_TYPE uxQueueMessagesWaiting( const xQueueHandle const pxQueue )\r
 {\r
 unsigned portBASE_TYPE uxReturn;\r
 \r
@@ -1173,7 +1179,7 @@ static void prvUnlockQueue( xQueueHandle pxQueue )
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-static signed portBASE_TYPE prvIsQueueEmpty( const xQueueHandle pxQueue )\r
+static signed portBASE_TYPE prvIsQueueEmpty( const xQueueHandle const pxQueue )\r
 {\r
 signed portBASE_TYPE xReturn;\r
 \r
@@ -1195,7 +1201,7 @@ signed portBASE_TYPE xReturn;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-static signed portBASE_TYPE prvIsQueueFull( const xQueueHandle pxQueue )\r
+static signed portBASE_TYPE prvIsQueueFull( const xQueueHandle const pxQueue )\r
 {\r
 signed portBASE_TYPE xReturn;\r
 \r