]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/queue.c
Multiple tidy up, documentation corrections and typo corrections highlighted by Tamas...
[freertos] / FreeRTOS / Source / queue.c
index a94b03ed8e64f00e8cb8a286c229c9686f28d93a..43ceaca9279003fb25648d304481d61c9bb2f293 100644 (file)
@@ -418,7 +418,7 @@ xQueueHandle xReturn = NULL;
        void *pxReturn;\r
 \r
                /* This function is called by xSemaphoreGetMutexHolder(), and should not\r
-               be called directly.  Note:  This is is a good way of determining if the\r
+               be called directly.  Note:  This is a good way of determining if the\r
                calling task is the mutex holder, but not a good way of determining the\r
                identity of the mutex holder, as the holder may change between the\r
                following critical section exiting and the function returning. */\r
@@ -570,6 +570,12 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
        configASSERT( pxQueue );\r
        configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( unsigned portBASE_TYPE ) 0U ) ) );\r
        configASSERT( !( ( xCopyPosition == queueOVERWRITE ) && ( pxQueue->uxLength != 1 ) ) );\r
+       #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )\r
+       {\r
+               configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );\r
+       }\r
+       #endif\r
+\r
 \r
        /* This function relaxes the coding standard somewhat to allow return\r
        statements within the function itself.  This is done in the interest\r
@@ -903,11 +909,11 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
                                                {\r
                                                        if( pxQueue->uxQueueType == queueQUEUE_IS_MUTEX )\r
                                                        {\r
-                                                               portENTER_CRITICAL();\r
+                                                               taskENTER_CRITICAL();\r
                                                                {\r
                                                                        vTaskPriorityInherit( ( void * ) pxQueue->pxMutexHolder );\r
                                                                }\r
-                                                               portEXIT_CRITICAL();\r
+                                                               taskEXIT_CRITICAL();\r
                                                        }\r
                                                }\r
                                                #endif\r
@@ -943,7 +949,7 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
 \r
        /* RTOS ports that support interrupt nesting have the concept of a maximum\r
        system call (or maximum API call) interrupt priority.  Interrupts that are\r
-       above the maximum system call priority are keep permanently enabled, even\r
+       above the maximum system call priority are kept permanently enabled, even\r
        when the RTOS kernel is in a critical section, but cannot make any calls to\r
        FreeRTOS API functions.  If configASSERT() is defined in FreeRTOSConfig.h\r
        then portASSERT_IF_INTERRUPT_PRIORITY_INVALID() will result in an assertion\r
@@ -1052,7 +1058,12 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
 \r
        configASSERT( pxQueue );\r
        configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( unsigned portBASE_TYPE ) 0U ) ) );\r
-\r
+       #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )\r
+       {\r
+               configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );\r
+       }\r
+       #endif\r
+       \r
        /* This function relaxes the coding standard somewhat to allow return\r
        statements within the function itself.  This is done in the interest\r
        of execution time efficiency. */\r
@@ -1164,11 +1175,11 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
                                {\r
                                        if( pxQueue->uxQueueType == queueQUEUE_IS_MUTEX )\r
                                        {\r
-                                               portENTER_CRITICAL();\r
+                                               taskENTER_CRITICAL();\r
                                                {\r
                                                        vTaskPriorityInherit( ( void * ) pxQueue->pxMutexHolder );\r
                                                }\r
-                                               portEXIT_CRITICAL();\r
+                                               taskEXIT_CRITICAL();\r
                                        }\r
                                }\r
                                #endif\r
@@ -1209,7 +1220,7 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
 \r
        /* RTOS ports that support interrupt nesting have the concept of a maximum\r
        system call (or maximum API call) interrupt priority.  Interrupts that are\r
-       above the maximum system call priority are keep permanently enabled, even\r
+       above the maximum system call priority are kept permanently enabled, even\r
        when the RTOS kernel is in a critical section, but cannot make any calls to\r
        FreeRTOS API functions.  If configASSERT() is defined in FreeRTOSConfig.h\r
        then portASSERT_IF_INTERRUPT_PRIORITY_INVALID() will result in an assertion\r
@@ -1285,7 +1296,7 @@ xQUEUE * const pxQueue = ( xQUEUE * ) xQueue;
 \r
        /* RTOS ports that support interrupt nesting have the concept of a maximum\r
        system call (or maximum API call) interrupt priority.  Interrupts that are\r
-       above the maximum system call priority are keep permanently enabled, even\r
+       above the maximum system call priority are kept permanently enabled, even\r
        when the RTOS kernel is in a critical section, but cannot make any calls to\r
        FreeRTOS API functions.  If configASSERT() is defined in FreeRTOSConfig.h\r
        then portASSERT_IF_INTERRUPT_PRIORITY_INVALID() will result in an assertion\r