OSA : OS_Queue_Send_TO

OS_Queue_Send_TO (queue, message, timeout)

Allowed only in taskSwitches contextUses timer

Same as OS_Queue_Send with exit if timeout expires.

OS_ENABLE_QUEUE constant must be defined in OSAcfg.h.

For PIC16, message queues can be allocated only in bank0 or bank1

Call allowed:

Only in task

Parameters:

queue Queue of messages descriptor. Variable of OST_QUEUE type.
message pointer to message body (OST_MSG)
timeout Time of wait in system ticks - calling OS_Timer periods

Returns:

timeout If timeout expired then system service OS_IsTimeout will return true

Example:

OST_QUEUE queue;
 
void Task (void)
{
    static char Buf[20];
    for (;;) {
        /*...*/
        OS_Queue_Send_TO (queue, buf, 100); // Wait 100 ticks
        if (OS_IsTimeout()) {
            // Message was not sent!
            /*...*/
        }
        /*...*/
    }
}

Old style name

OS_SendQMsgTimeout

See also