Merge pull request #11145 from Tharazi97/CountFunctionQueue

Implement queue.count()
pull/11104/head
Seppo Takalo 2019-08-06 11:30:46 +03:00 committed by GitHub
commit 34813edada
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -107,6 +107,17 @@ public:
return osMessageQueueGetSpace(_id) == 0;
}
/** Get number of queued messages in the queue.
*
* @return Number of items in the queue
*
* @note You may call this function from ISR context.
*/
uint32_t count() const
{
return osMessageQueueGetCount(_id);
}
/** Inserts the given element to the end of the queue.
*
* This function puts the message pointed to by `data` into the queue. The