<< Previous | Next >>

OSMboxPostOpt

INT8U OSMboxPostOpt( OS_EVENT * pevent, void * msg, INT8U opt );

Description

This function sends a message to a mailbox.

NOTE Interrupts can be disabled for a long time if you do a "broadcast." The interrupt disable time is proportional to the number of tasks waiting on the mailbox.

Parameters

pevent
Pointer to mailbox's event control block.

msg
Pointer to the message to send. A null pointer must not be sent.

opt
Determines the type of POST performed:

  • OS_POST_OPT_NONE - POST to a single waiting task (Identical to OS_MboxPost())

  • OS_POST_OPT_BROADCAST - POST to ALL tasks that are waiting on the mailbox

Return value

OS_NO_ERR
The call was successful and the message was sent.

OS_MBOX_FULL
The mailbox already contains a message. Only one message at a time can be sent and thus, the message MUST be consumed before another can be sent.

OS_ERR_EVENT_TYPE
Attempting to post to a non-mailbox.

OS_ERR_PEVENT_NULL
If pevent is a null pointer

OS_ERR_POST_NULL_PTR
If you are attempting to post a null pointer

Library

OS_MBOX.C (Prior to DC 8:UCOS2.LIB)


Dynamic C Functions << Previous | Next >> rabbit.com