- /* If there was a task waiting for data to arrive on the\r
- queue then unblock it now. */\r
- if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE )\r
- {\r
- if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) == pdTRUE )\r
- {\r
- /* The unblocked task has a priority higher than\r
- our own so yield immediately. */\r
- portYIELD_WITHIN_API();\r
- }\r
- else\r
- {\r
- mtCOVERAGE_TEST_MARKER();\r
- }\r
- }\r
- else\r
- {\r
- mtCOVERAGE_TEST_MARKER();\r
- }\r
-\r
- taskEXIT_CRITICAL();\r
- return pdPASS;\r
- }\r
- else\r
- {\r
- if( xTicksToWait == ( TickType_t ) 0 )\r
- {\r
- taskEXIT_CRITICAL();\r
- return errQUEUE_FULL;\r
- }\r
- else if( xEntryTimeSet == pdFALSE )\r
- {\r
- vTaskSetTimeOutState( &xTimeOut );\r
- xEntryTimeSet = pdTRUE;\r
- }\r
- }\r
- }\r
- taskEXIT_CRITICAL();\r
-\r
- taskENTER_CRITICAL();\r
- {\r
- if( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE )\r
- {\r
- if( prvIsQueueFull( pxQueue ) != pdFALSE )\r
- {\r
- traceBLOCKING_ON_QUEUE_SEND( pxQueue );\r
- vTaskPlaceOnEventList( &( pxQueue->xTasksWaitingToSend ), xTicksToWait );\r
- portYIELD_WITHIN_API();\r
- }\r
- else\r
- {\r
- mtCOVERAGE_TEST_MARKER();\r
- }\r
- }\r
- else\r
- {\r
- taskEXIT_CRITICAL();\r
- traceQUEUE_SEND_FAILED( pxQueue );\r
- return errQUEUE_FULL;\r
- }\r
- }\r
- taskEXIT_CRITICAL();\r
- }\r
- }\r
-\r
-#endif /* configUSE_ALTERNATIVE_API */\r
-/*-----------------------------------------------------------*/\r
-\r
-#if ( configUSE_ALTERNATIVE_API == 1 )\r
-\r
- BaseType_t xQueueAltGenericReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait, BaseType_t xJustPeeking )\r
- {\r
- BaseType_t xEntryTimeSet = pdFALSE;\r
- TimeOut_t xTimeOut;\r
- int8_t *pcOriginalReadPosition;\r
- Queue_t * const pxQueue = ( Queue_t * ) xQueue;\r