OSA : OS_Msg_Accept

OS_Msg_Accept (msg_cb, os_msg_type_var)
OS_Msg_Accept_I (msg_cb, os_msg_type_var)

Accept existing message. Before calling this service you should be sure that a message exists. After service is executed message will be cleared.

Call allowed:

Everywhere

Parameters:

msg_cb Pointer to message descriptor. Variable of OST_MSG_CB type
os_msg_type_var Variable of OST_MSG type, where pointer to message will be placed

Returns:

nothing

Example:

OST_MSG_CB msg_cb;
 
void Task (void)
{
    OST_MSG msg;
    for (;;) {
        /*...*/
        if (OS_Msg_Check(msg_cb)) {        // if message exists
            OS_Msg_Accept (msg_cb, msg);   // than accept it and store pointer
                                           // to msg variable
        }
        /*...*/
    }
}

Old style name

OS_AcceptMsg

See also