It can be usefull to add some checking in xQueueCreateCountingSemaphore() against uxCountValue == 0. If you make a mistake and gives 0 when creating counting semaphore as max value the xQUEUE::uxMessagesWaiting will underflow when you use xSemaphoreTakeXXX() There is long way to truck this kind of bugs :(
The following two lines have been added on entry to the function:
configASSERT( uxMaxCount != 0 );
configASSERT( uxInitialCount <= uxMaxCount );
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.