We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents dd2d585 + 32bdde5 commit 34813edCopy full SHA for 34813ed
rtos/Queue.h
@@ -107,6 +107,17 @@ class Queue : private mbed::NonCopyable<Queue<T, queue_sz> > {
107
return osMessageQueueGetSpace(_id) == 0;
108
}
109
110
+ /** Get number of queued messages in the queue.
111
+ *
112
+ * @return Number of items in the queue
113
114
+ * @note You may call this function from ISR context.
115
+ */
116
+ uint32_t count() const
117
+ {
118
+ return osMessageQueueGetCount(_id);
119
+ }
120
+
121
/** Inserts the given element to the end of the queue.
122
*
123
* This function puts the message pointed to by `data` into the queue. The
0 commit comments