/* Reset a Message Queue to initial empty state.  */
osStatus_t osMessageQueueReset(osMessageQueueId_t msgq_id)
/* Reset a Message Queue to initial empty state.  */
osStatus_t osMessageQueueReset(osMessageQueueId_t msgq_id)
{
	struct cv2_msgq *msgq = (struct cv2_msgq *)msgq_id;
	if (msgq == NULL) {
		return osErrorParameter;
	}
	if (k_is_in_isr()) {
		return osErrorISR;
	}
	k_msgq_purge(&msgq->z_msgq);
	return osOK;
}