Skip to end of metadata
Go to start of metadata

Description

Sends a message to a task.

Files

os.h/os_task.c

Prototype

void  OSTaskQPost (OS_TCB       *p_tcb,
                   void         *p_void,
                   OS_MSG_SIZE   msg_size,
                   OS_OPT        opt,
                   RTOS_ERR     *p_err)

Arguments

p_tcb

Pointer to the TCB of the task receiving a message. If you specify a NULL pointer, the message will be posted to the task's queue of the calling task. In other words, you'd be posting a message to yourself.

p_void

Pointer to the message to send.

msg_size

The size of the message sent (in bytes).

opt

Specifies whether the post will be FIFO or LIFO:

OS_OPT_POST_FIFO           Post at the end of the queue.
OS_OPT_POST_LIFO           Post at the front of the queue.
OS_OPT_POST_NO_SCHED   Do not run the scheduler after the post.

Note(s): (1) OS_OPT_POST_NO_SCHED can be added with one of the other options.

p_err

Pointer to the variable that will receive one of the following error code(s) from this function:

RTOS_ERR_NONE
RTOS_ERR_WOULD_OVF
RTOS_ERR_NO_MORE_RSRC
RTOS_ERR_INVALID_STATE

Returned Value

None.

Notes / Warnings

None.

  • No labels