/* Put a Message into a Queue or timeout if Queue is full.  */
__STATIC_INLINE osStatus_t isrRtxMessageQueuePut(osMessageQueueId_t mq_id, const void *msg_ptr, uint8_t msg_prio, uint32_t timeout)
/* Put a Message into a Queue or timeout if Queue is full.  */
__STATIC_INLINE osStatus_t isrRtxMessageQueuePut(osMessageQueueId_t mq_id, const void *msg_ptr, uint8_t msg_prio, uint32_t timeout)
{
    EvrRtxMessageQueueError(mq, (int32_t)osErrorParameter);
    return osErrorParameter;
  }
  msg = osRtxMemoryPoolAlloc(&mq->mp_info);
  if (msg != NULL) {
    memcpy(&msg[1], msg_ptr, mq->msg_size);
    msg->id       = osRtxIdMessage;
    msg->flags    = 0U;
    msg->priority = msg_prio;
    *((const void **)(void *)&msg->prev) = msg_ptr;
    *(      (void **)        &msg->next) = mq;
    osRtxPostProcess(osRtxObject(msg));
    EvrRtxMessageQueueInsertPending(mq, msg_ptr);
    status = osOK;
  } else {
    EvrRtxMessageQueueNotInserted(mq, msg_ptr);
    status = osErrorResource;
  }
  return status;
}