...
Files
os.h/os_task.c
Prototype
Code Block |
---|
void OSTaskQPost (OS_TCB *p_tcb,
void *p_void,
OS_MSG_SIZE msg_size,
OS_OPT opt,
OS_ERR *p_err) |
Arguments
p_tcb
is a pointer to the TCB of the task. Note that it is possible to post a message to the calling task (i.e., self) by specifying a NULL
pointer, or the address of its TCB.
...
If the call was successful and the message was posted to the task’s message queue.
OS_ERR_INT_Q_FULL
If OS_CFG_ISR_POST_DEFERRED_EN
is to DEF_ENABLED
in os_cfg.h
: If the deferred interrupt post queue is full.
OS_ERR_MSG_POOL_EMPTY
If running out of OS_MSG
to hold the message being posted.
...
Notes/Warnings
None
Example Usage
Code Block | ||
---|---|---|
| ||
OS_TCB CommRxTaskTCB;
CPU_INT08U CommRxBuf[100];
void CommTaskRx (void *p_arg)
{
OS_ERR err;
(void)&p_arg;
while (DEF_ON) {
:
OSTaskQPost(&CommRxTaskTCB,
(void *)&CommRxBuf[0],
sizeof(CommRxBuf),
OS_OPT_POST_FIFO,
&err);
/* Check "err" */
:
:
}
} |