MCPcopy Create free account
hub / github.com/FreeRTOS/FreeRTOS-Kernel / xQueueCreateCountingSemaphoreStatic

Function xQueueCreateCountingSemaphoreStatic

queue.c:718–741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

716#if ( ( configUSE_COUNTING_SEMAPHORES == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
717
718 QueueHandle_t xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount,
719 const UBaseType_t uxInitialCount,
720 StaticQueue_t * pxStaticQueue )
721 {
722 QueueHandle_t xHandle;
723
724 configASSERT( uxMaxCount != 0 );
725 configASSERT( uxInitialCount <= uxMaxCount );
726
727 xHandle = xQueueGenericCreateStatic( uxMaxCount, queueSEMAPHORE_QUEUE_ITEM_LENGTH, NULL, pxStaticQueue, queueQUEUE_TYPE_COUNTING_SEMAPHORE );
728
729 if( xHandle != NULL )
730 {
731 ( ( Queue_t * ) xHandle )->uxMessagesWaiting = uxInitialCount;
732
733 traceCREATE_COUNTING_SEMAPHORE();
734 }
735 else
736 {
737 traceCREATE_COUNTING_SEMAPHORE_FAILED();
738 }
739
740 return xHandle;
741 }
742
743#endif /* ( ( configUSE_COUNTING_SEMAPHORES == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) */
744/*-----------------------------------------------------------*/

Calls 1

Tested by

no test coverage detected