Adds SemphrGetCountFromISR with QMsgWaitingFromISR (#345)
* Adds SemphrGetCountFromISR with QMsgWaitingFromISR
diff --git a/.github/lexicon.txt b/.github/lexicon.txt
index cad0881..7bc3bd6 100644
--- a/.github/lexicon.txt
+++ b/.github/lexicon.txt
@@ -2440,6 +2440,7 @@
uxsavedtaskstackpointer
uxschedulersuspended
uxsemaphoregetcount
+uxsemaphoregetcountfromisr
uxstate
uxstreambuffernumber
uxtaskgetnumberoftasks
diff --git a/include/semphr.h b/include/semphr.h
index ddbb585..56d9ed2 100644
--- a/include/semphr.h
+++ b/include/semphr.h
@@ -1172,4 +1172,18 @@
*/
#define uxSemaphoreGetCount( xSemaphore ) uxQueueMessagesWaiting( ( QueueHandle_t ) ( xSemaphore ) )
+/**
+ * semphr.h
+ * <pre>
+ * UBaseType_t uxSemaphoreGetCountFromISR( SemaphoreHandle_t xSemaphore );
+ * </pre>
+ *
+ * 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 */