| 746 | #if ( ( configUSE_COUNTING_SEMAPHORES == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) |
| 747 | |
| 748 | QueueHandle_t xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount, |
| 749 | const UBaseType_t uxInitialCount ) |
| 750 | { |
| 751 | QueueHandle_t xHandle; |
| 752 | |
| 753 | configASSERT( uxMaxCount != 0 ); |
| 754 | configASSERT( uxInitialCount <= uxMaxCount ); |
| 755 | |
| 756 | xHandle = xQueueGenericCreate( uxMaxCount, queueSEMAPHORE_QUEUE_ITEM_LENGTH, queueQUEUE_TYPE_COUNTING_SEMAPHORE ); |
| 757 | |
| 758 | if( xHandle != NULL ) |
| 759 | { |
| 760 | ( ( Queue_t * ) xHandle )->uxMessagesWaiting = uxInitialCount; |
| 761 | |
| 762 | traceCREATE_COUNTING_SEMAPHORE(); |
| 763 | } |
| 764 | else |
| 765 | { |
| 766 | traceCREATE_COUNTING_SEMAPHORE_FAILED(); |
| 767 | } |
| 768 | |
| 769 | return xHandle; |
| 770 | } |
| 771 | |
| 772 | #endif /* ( ( configUSE_COUNTING_SEMAPHORES == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) */ |
| 773 | /*-----------------------------------------------------------*/ |
no test coverage detected