@CHIP-RTOS C Library V2.00 - RTOS API
RTX_Wait_For_MsgP
This function parks the calling task
on the specified message exchange message queue. The Message
Exchange Manager will then wake up this task when either a message
is available or a specified wait period timeout expires. int RTX_Wait_For_MsgP ( unsigned int msgID, unsigned int prio,
char far *msg, long timeout ); Parameters
msgID
- The message exchange ID output on
call to RTX_Create_Msg.
msg
- Pointer to a 12 byte user buffer for storing the
message (if any)
timeout
- Maximum time (milliseconds) to wait for a message:
timeout == 0 -> Wait forever
timeout < 0 -> invalid (must be >= 0)
prio
- priority for wait (0-0xFFFF), 0=highest. Specify here
the priority of the calling task's access to the messages. To wait
in FIFO order, have all callers use the same value here. A task
can cut in line ahead of other waiting tasks by setting this field
to a higher priority (lower number) than used by the other tasks.
Return Value
- 0 on success else
error code,
invalid ID or -28: no message available.
Comments
- This procedure is identical to
RTX_Wait_For_Msg, except for
method of parameter passing.
The format of the 12 byte message received is defined by the
application program.
When more than one message is available at the message exchange, the
oldest (FIFO order) message from the highest priority message
queue will be reported. Note that message priority and the
wait priority (the prio
parameter) are independent and
unrelated concepts.
See Also
RTOS API
- This library function invokes a RTOS software interrupt.
Refer to this RTOS API function's
documentation
for more details.
This API List
List of C Libraries
@CHIP-RTOS Main Index
End of document
|