Versions Compared

Key

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

...

Anchor10800891080089 Message Queues Anchor10800901080090Table C-12 shows the difference in API for message-queue management. Anchor11815851181585  

...

µC/OS-II (os_q.c)

...

...

µC/OS-III (os_q.c)

...

Note

...

...

rowspan4

void *

...

OSQAccept(

...

...

OS_EVENT *pevent,

...

INT8U *perr);

...

rowspan4

...

rowspan4

...

...

(1)

...

rowspan4

...

OS_EVENT *

...

OSQCreate(

...

...

void **start,

...

INT16U size);

...

rowspan4

void

...

OSQCreate(

...

OS_Q *p_q,

...

...

CPU_CHAR *p_name,

...

...

OS_MSG_QTY max_qty,

...

...

OS_ERR *p_err);

...

rowspan4

...

(2)

...

...

rowspan5

...

OS_EVENT *

...

OSQDel(

...

OS_EVENT *pevent,

...

INT8U opt,

...

INT8U *perr);

...

rowspan5

OS_OBJ_QTY,

...

OSQDel(

...

OS_Q *p_q,

...

...

OS_OPT opt,

...

OS_ERR *p_err);

...

rowspan5

...

...

rowspan7

...

INT8U

...

...

OSQFlush(

...

OS_EVENT *pevent);

...

...

OS_MSG_QTY

...

OSQFlush(

...

OS_Q *p_q,

...

OS_ERR *p_err);

...

rowspan7

...

...

rowspan8

...

void *

...

...

OSQPend(

...

OS_EVENT *pevent,

...

INT32U timeout,

...

...

INT8U *perr);

...

rowspan8

...

void *

...

OSQPend(

...

OS_Q *p_q,

...

OS_MSG_SIZE *p_msg_size,

...

OS_TICK timeout,

...

OS_OPT opt,

...

...

CPU_TS *p_ts,

...

OS_ERR *p_err);

...

...

(3)

...

...

rowspan12

...

INT8U

...

OSQPendAbort(

...

OS_EVENT *pevent,

...

INT8U opt,

...

INT8U *perr);

...

rowspan12

OS_OBJ_QTY

...

OSQPendAbort(

...

OS_Q *p_q,

...

...

OS_OPT opt,

...

OS_ERR *p_err);

...

...

rowspan4

...

INT8U

...

OSQPost(

...

OS_EVENT *pevent,

...

...

void *pmsg);

...

...

void

...

OSQPost(

...

...

OS_Q *p_q,

...

void *p_void,

...

OS_MSG_SIZE msg_size,

...

OS_OPT opt,

...

OS_ERR *p_err);

...

...

(4)

...

rowspan5

...

INT8U

...

OSQPostFront(

...

OS_EVENT *pevent,

...

...

void *pmsg);

...

rowspan5

...

rowspan5

...

...

rowspan5

INT8U

...

...

OSQPostOpt(

...

OS_EVENT *pevent,

...

void *pmsg,

...

...

INT8U opt);

...

rowspan5

...

...

rowspan5

...

(4)

...

...

rowspan4

...

INT8U

...

OSQQuery(

...

OS_EVENT *pevent,

...

...

OS_Q_DATA *p_q_data);

...

rowspan4

...

...

rowspan4

...

(5)

...

Table C-12 Message Queue Management API

...

TC-12(1) In µC/OS-III, there is no “accept” API as this feature is built into the OSQPend() by specifying the OS_OPT_PEND_NON_BLOCKING option.

...

TC-12(2) In µC/OS-II, OSQCreate() returns the address of an OS_EVENT, which is used as the “handle” to the message queue. In µC/OS-III, the application must allocate storage for an OS_Q object, which serves the same purpose as the OS_EVENT. The benefit in µC/OS-III is that it is not necessary to predetermine at compile time, the number of message queues.

...

TC-12(3) µC/OS-III returns additional information when a message queue is posted. Specifically, the sender includes the size of the message and takes a snapshot of the current timestamp and stores it in the message. The receiver of the message therefore knows when the message was posted.

...

TC-12(4) In µC/OS-III, OSQPost() offers a number of options that replaces the three post functions provided in µC/OS-II.

...

TC-12(5) µC/OS-III does not provide query services as they were rarely used.