/* Get the number of messaged stored in a queue.  */
uint32_t osMessageWaiting(osMessageQId queue_id)
/* Get the number of messaged stored in a queue.  */
uint32_t osMessageWaiting(osMessageQId queue_id)
{
  if (inHandlerMode()) {
    return uxQueueMessagesWaitingFromISR(queue_id);
  }
  else
  {
    return uxQueueMessagesWaiting(queue_id);
  }
}