I am running FreeRTOS version 8.2.2 and am wondering why there is no function provided to get the count value of a counting semaphore. While I did find a workaround - cast the handle as a queue handle and use uxQueueMessages Waiting() - it seems like having a dedicated function would be worthwhile. Any thoughts?
Any of the queue functions can be used on semahores too. I can add a "get current count" macro that calls the queue function.
I think that would be great - particularly if it found its way into the documentation. :-)
I have added the line:
define xSemaphoreGetCount( xSemaphore ) uxQueueMessagesWaiting( (
QueueHandle_t ) ( xSemaphore ) )
but not checked it in yet. It will get checked in after it has been tested.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.