/* Get a Message from a Queue or timeout if Queue is empty.  */
__STATIC_INLINE osStatus_t isrRtxMessageQueueGet(osMessageQueueId_t mq_id, void *msg_ptr, uint8_t *msg_prio, uint32_t timeout)
/* Get a Message from a Queue or timeout if Queue is empty.  */
__STATIC_INLINE osStatus_t isrRtxMessageQueueGet(osMessageQueueId_t mq_id, void *msg_ptr, uint8_t *msg_prio, uint32_t timeout)
{
    EvrRtxMessageQueueError(mq, (int32_t)osErrorParameter);
    return osErrorParameter;
  }
  msg = MessageQueueGet(mq);
  if (msg != NULL) {
    memcpy(msg_ptr, &msg[1], mq->msg_size);
    if (msg_prio != NULL) {
      *msg_prio = msg->priority;
    }
    *((os_message_queue_t **)(void *)&msg[1]) = mq;
    osRtxPostProcess(osRtxObject(msg));
    EvrRtxMessageQueueRetrieved(mq, msg_ptr);
    status = osOK;
  } else {
    EvrRtxMessageQueueNotRetrieved(mq, msg_ptr);
    status = osErrorResource;
  }
  return status;
}