This function causes the current task to wait for a message to be posted to it.
void *OSTaskQPend (OS_TICK timeout, OS_OPT opt, OS_MSG_SIZE *p_msg_size, CPU_TS *p_ts, RTOS_ERR *p_err)
timeout period (in clock ticks). If non-zero, your task will wait for a message to arrive up to the amount of time specified by this argument. If you specify 0, your task will wait forever, or until a message arrives.
Determines if the user wants to block if the task's queue is empty or not:
OS_OPT_PEND_BLOCKING Task will block.
OS_OPT_PEND_NON_BLOCKING Task will NOT block.
Pointer to a variable that will receive the size of the message.
Pointer to a variable that will receive the timestamp of when the message was received. If you pass a NULL pointer (i.e.
(CPU_TS *)0), you will not get the timestamp. In other words, passing a NULL pointer is valid and indicates that you don't need the timestamp.
Pointer to the variable that will receive one of the following error code(s) from this function:
A pointer to the message received or a NULL pointer upon error.
Notes / Warnings
It is possible to receive a NULL pointer when there are no errors.