Versions Compared

Key

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

...

Anchor10800891080089 Message Queues Anchor10800901080090 Table C-12 This table shows the difference in API for message-queue management.anchor

Panel

...

1091600
HTML Table
summary
classPlain_Table
Table Row (tr)
Table Cell (td)
Anchor
10915981091598
titleMessage Queues API


µC/OS-II (os_q.c)
Table Cell (td)
Anchor
1091600
µC/OS-III (os_q.c)
Table Cell (td) Anchor10916021091602
Note
Table Row (tr) Table Cell (td)
rowspan4
Anchor10916041091604
void
* Anchor10916051091605 OSQAccept( Anchor10916061091606
 * 
 OSQAccept( 
     OS_EVENT  *pevent,
Anchor10916071091607 INT8U
 
     INT8U     *perr);
Table Cell (td)
rowspan4
Anchor10916091091609   Table Cell (td)
rowspan4
anchor1091611
1091611

(1)
Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Cell (td)
rowspan4
Anchor10916311091631
OS_EVENT
* Anchor10916321091632 OSQCreate( Anchor10916331091633 void **start, Anchor10916341091634 INT16U size); Table Cell (td)
rowspan4
Anchor10916361091636 void Anchor10916371091637 OSQCreate( Anchor10916381091638 OS_Q *p_q, Anchor10916391091639 CPU_CHAR *p_name, Anchor10916401091640 OS_MSG_QTY max_qty, Anchor10916411091641 OS_ERR *p_err); Table Cell (td)
rowspan4
Anchor10916431091643 (2) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Cell (td)
rowspan5
Anchor10916631091663 OS_EVENT * Anchor10916641091664 OSQDel( Anchor10916651091665 OS_EVENT *pevent, Anchor10916661091666 INT8U opt, Anchor10916671091667 INT8U *perr); Table Cell (td)
rowspan5
Anchor10916691091669 OS_OBJ_QTY, Anchor10916701091670 OSQDel( Anchor10916711091671 OS_Q *p_q, Anchor10916721091672 OS_OPT opt, Anchor10916731091673 OS_ERR *p_err); Table Cell (td)
rowspan5
Anchor10916751091675   Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Cell (td)
rowspan7
Anchor10917011091701 INT8U Anchor10917021091702 OSQFlush( Anchor10917031091703 OS_EVENT *pevent); Table Cell (td)
rowspan7
Anchor10917051091705 OS_MSG_QTY Anchor10917061091706 OSQFlush( Anchor10917071091707 OS_Q *p_q, Anchor10917081091708 OS_ERR *p_err); Table Cell (td)
rowspan7
Anchor10917101091710   Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Cell (td)
rowspan8
Anchor10917481091748 void * Anchor10917491091749 OSQPend( Anchor10917501091750 OS_EVENT *pevent, Anchor10917511091751 INT32U timeout, Anchor10917521091752 INT8U *perr); Table Cell (td)
rowspan8
Anchor10917541091754 void * Anchor10917551091755 OSQPend( Anchor10917561091756 OS_Q *p_q, Anchor10917571091757 OS_MSG_SIZE *p_msg_size, Anchor10917581091758 OS_TICK timeout, Anchor10917591091759 OS_OPT opt, Anchor10917601091760 CPU_TS *p_ts, Anchor10917611091761 OS_ERR *p_err); Table Cell (td)
rowspan8
Anchor10917631091763 (3) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Cell (td)
rowspan12
Anchor10918071091807 INT8U Anchor10918081091808 OSQPendAbort( Anchor10918091091809 OS_EVENT *pevent, Anchor10918101091810 INT8U opt, Anchor10918111091811 INT8U *perr); Table Cell (td)
rowspan12
Anchor10918131091813 OS_OBJ_QTY Anchor10918141091814 OSQPendAbort( Anchor10918151091815 OS_Q *p_q, Anchor10918161091816 OS_OPT opt, Anchor10918171091817 OS_ERR *p_err); Table Cell (td)
rowspan12
Anchor10918191091819   Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Cell (td)
rowspan4
Anchor10918871091887 INT8U Anchor10918881091888 OSQPost( Anchor10918891091889 OS_EVENT *pevent, Anchor10918901091890 void *pmsg); Table Cell (td)
rowspan4
Anchor10918921091892 void Anchor10918931091893 OSQPost( Anchor10918941091894 OS_Q *p_q, Anchor10918951091895 void *p_void, Anchor10918961091896 OS_MSG_SIZE msg_size, Anchor10918971091897 OS_OPT opt, Anchor10918981091898 OS_ERR *p_err); Table Cell (td)
rowspan4
Anchor10919001091900 (4) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Cell (td)
rowspan5
Anchor10919201091920 INT8U Anchor10919261091926 OSQPostFront( Anchor10919321091932 OS_EVENT *pevent, Anchor10919381091938 void *pmsg); Table Cell (td)
rowspan5
Anchor10919461091946   Table Cell (td)
rowspan5
Anchor10919481091948   Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Cell (td)
rowspan5
Anchor10919501091950 INT8U Anchor10919561091956 OSQPostOpt( Anchor10919621091962 OS_EVENT *pevent, Anchor10919681091968 void *pmsg, Anchor10919741091974 INT8U opt); Table Cell (td)
rowspan5
Anchor10919521091952   Table Cell (td)
rowspan5
Anchor10919781091978 (4) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Row (tr) Table Cell (td)
rowspan4
Anchor10919801091980 INT8U Anchor10919861091986 OSQQuery( Anchor10919921091992 OS_EVENT *pevent, Anchor10919981091998 OS_Q_DATA *p_q_data); Table Cell (td)
rowspan4
Anchor10919821091982   Table Cell (td)
rowspan4
Anchor10920021092002 (5) Table Row (tr) Table Row (tr) Table Row (tr)

...

 * 
 OSQCreate( 
     void     **start, 
     INT16U     size);
void 
 OSQCreate( 
     OS_Q         *p_q, 
     CPU_CHAR     *p_name, 
     OS_MSG_QTY    max_qty, 
     OS_ERR       *p_err);
(2)
OS_EVENT * 
 OSQDel( 
     OS_EVENT  *pevent, 
     INT8U      opt, 
     INT8U     *perr);
OS_OBJ_QTY, 
 OSQDel( 
     OS_Q         *p_q, 
     OS_OPT        opt, 
     OS_ERR       *p_err);

INT8U 
 OSQFlush( 
     OS_EVENT  *pevent);
OS_MSG_QTY 
 OSQFlush( 
     OS_Q         *p_q, 
     OS_ERR       *p_err);

void * 
 OSQPend( 
     OS_EVENT  *pevent, 
     INT32U     timeout, 
     INT8U     *perr);
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)
INT8U 
 OSQPendAbort( 
     OS_EVENT  *pevent, 
     INT8U      opt, 
     INT8U     *perr);
OS_OBJ_QTY 
 OSQPendAbort( 
     OS_Q         *p_q, 
     OS_OPT        opt, 
     OS_ERR       *p_err);

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)
INT8U 
 OSQPostFront( 
     OS_EVENT  *pevent, 
     void      *pmsg);


INT8U 
 OSQPostOpt( 
     OS_EVENT  *pevent, 
     void      *pmsg, 
     INT8U      opt);

(4)
INT8U 
 OSQQuery( 
     OS_EVENT  *pevent, 
     OS_Q_DATA *p_q_data);

(5)



Panel
bgColor#f0f0f0

(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.

...

(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.

...

(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.

...

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

...

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