Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

determines the type of POST performed. The last two options may be added to either OS_OPT_POST_FIFO or OS_OPT_POST_LIFO to create different combinations:

OS_OPT_POST_FIFO

POST message to the end of the queue (FIFO), or send message to a single waiting task.

OS_OPT_POST_LIFO

POST message to the front of the queue (LIFO), or send message to a single waiting task

OS_OPT_POST_ALL

POST message to ALL tasks that are waiting on the queue. This option can be added to either OS_OPT_POST_FIFO or OS_OPT_POST_LIFO.

OS_OPT_POST_NO_SCHED

This option specifies to not call the scheduler after the post and therefore the caller is resumed, even if the message was posted to a message queue with tasks having a higher priority than the caller.

You would use this option if the task (or ISR) calling OSQPost() will do additional posts, in this case, the caller does not want to reschedule until finished, and, multiple posts are to take effect simultaneously.

 

p_err

is a pointer to a variable that will contain an error code returned by this function.

...

Returned Value

None

Notes/Warnings

  • Queues must be created before they are used.
  • Possible combinations of options are:

OS_OPT_POST_FIFO
OS_OPT_POST_LIFO
OS_OPT_POST_FIFO

...

+

...

OS_OPT_POST_ALL
OS_OPT_POST_LIFO

...

+

...

OS_OPT_POST_ALL
OS_OPT_POST_FIFO

...

+

...

OS_OPT_POST_NO_SCHED
OS_OPT_POST_LIFO

...

+

...

OS_OPT_POST_NO_SCHED
OS_OPT_POST_FIFO

...

+

...

OS_OPT_POST_ALL

...

+

...

OS_OPT_POST_NO_SCHED
OS_OPT_POST_LIFO

...

+

...

OS_OPT_POST_ALL

...

+

...

OS_OPT_POST_NO_SCHED

...

 

  • Although the example below shows calling OSQPost() from a task, it can also be called from an ISR.

Example