Skip to content

Commit bad8f01

Browse files
authored
Adds SemphrGetCountFromISR with QMsgWaitingFromISR (#345)
* Adds SemphrGetCountFromISR with QMsgWaitingFromISR
1 parent eec4233 commit bad8f01

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.github/lexicon.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2440,6 +2440,7 @@ uxsavedmaskvalue
24402440
uxsavedtaskstackpointer
24412441
uxschedulersuspended
24422442
uxsemaphoregetcount
2443+
uxsemaphoregetcountfromisr
24432444
uxstate
24442445
uxstreambuffernumber
24452446
uxtaskgetnumberoftasks

include/semphr.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,4 +1172,18 @@ typedef QueueHandle_t SemaphoreHandle_t;
11721172
*/
11731173
#define uxSemaphoreGetCount( xSemaphore ) uxQueueMessagesWaiting( ( QueueHandle_t ) ( xSemaphore ) )
11741174

1175+
/**
1176+
* semphr.h
1177+
* <pre>
1178+
* UBaseType_t uxSemaphoreGetCountFromISR( SemaphoreHandle_t xSemaphore );
1179+
* </pre>
1180+
*
1181+
* If the semaphore is a counting semaphore then uxSemaphoreGetCountFromISR() returns
1182+
* its current count value. If the semaphore is a binary semaphore then
1183+
* uxSemaphoreGetCountFromISR() returns 1 if the semaphore is available, and 0 if the
1184+
* semaphore is not available.
1185+
*
1186+
*/
1187+
#define uxSemaphoreGetCountFromISR( xSemaphore ) uxQueueMessagesWaitingFromISR( ( QueueHandle_t ) ( xSemaphore ) )
1188+
11751189
#endif /* SEMAPHORE_H */

0 commit comments

Comments
 (0)