From bad8f01afd2554d6f673f4ea9ea7adb51cd9da33 Mon Sep 17 00:00:00 2001 From: Raul Rojas Date: Tue, 8 Jun 2021 20:48:52 -0400 Subject: [PATCH] Adds SemphrGetCountFromISR with QMsgWaitingFromISR (#345) * Adds SemphrGetCountFromISR with QMsgWaitingFromISR --- .github/lexicon.txt | 1 + include/semphr.h | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/.github/lexicon.txt b/.github/lexicon.txt index cad08816f..7bc3bd6e3 100644 --- a/.github/lexicon.txt +++ b/.github/lexicon.txt @@ -2440,6 +2440,7 @@ uxsavedmaskvalue uxsavedtaskstackpointer uxschedulersuspended uxsemaphoregetcount +uxsemaphoregetcountfromisr uxstate uxstreambuffernumber uxtaskgetnumberoftasks diff --git a/include/semphr.h b/include/semphr.h index ddbb585cc..56d9ed20e 100644 --- a/include/semphr.h +++ b/include/semphr.h @@ -1172,4 +1172,18 @@ typedef QueueHandle_t SemaphoreHandle_t; */ #define uxSemaphoreGetCount( xSemaphore ) uxQueueMessagesWaiting( ( QueueHandle_t ) ( xSemaphore ) ) +/** + * semphr.h + *
+ * UBaseType_t uxSemaphoreGetCountFromISR( SemaphoreHandle_t xSemaphore );
+ * 
+ * + * If the semaphore is a counting semaphore then uxSemaphoreGetCountFromISR() returns + * its current count value. If the semaphore is a binary semaphore then + * uxSemaphoreGetCountFromISR() returns 1 if the semaphore is available, and 0 if the + * semaphore is not available. + * + */ +#define uxSemaphoreGetCountFromISR( xSemaphore ) uxQueueMessagesWaitingFromISR( ( QueueHandle_t ) ( xSemaphore ) ) + #endif /* SEMAPHORE_H */