Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
void  OSQCreate (OS_Q        *p_q,
                 CPU_CHAR    *p_name,
                 OS_MSG_QTY   max_qty,
                 OS_ERR      *p_err)

File

Called from

Code enabled by

os_q.c

Task or startup code

OS_CFG_Q_EN and OS_CFG_MSG_EN

...

Description

Creates a message queue. A message queue allows tasks or ISRs to send pointer-sized variables (messages) to one or more tasks. The meaning of the messages sent are application specific.

Files

os.h/os_q.c

Prototype

Arguments

p_q

is a pointer to the message queue control block. It is assumed that storage for the message queue will be allocated in the application. The user will need to declare a “global” variable as follows, and pass a pointer to this variable to OSQCreate():

...

If OS_SAFETY_CRITICAL_IEC61508 is defined: you called this after calling OSSafetyCriticalStart() and thus you are no longer allowed to create additional kernel objects.

Returned Value

None

Required Configuration

OS_CFG_Q_EN must be enabled in os_cfg.h. Refer to uC-OS-III Configuration Manual

Callers

Application.

Notes/Warnings

  1. Queues must be created before they are used.

Example Usage