Table C-12 This table shows the difference in API for message-queue management.
Panel |
---|
|
µC/OS-II (os_q.c ) | µC/OS-III (os_q.c ) | Note |
---|
void * |
|
...
...
...
...
...
...
...
...
...
...
...
...
OS_ERR *p_err); | (2) | OS_EVENT * |
|
...
...
...
INT8U opt,
...
INT8U opt,
INT8U *perr); | OS_OBJ_QTY, |
|
...
...
...
...
...
...
...
OS_EVENT *pevent); | OS_MSG_QTY |
|
...
...
...
...
...
...
...
INT32U timeout,
...
INT32U timeout,
INT8U *perr); | void * |
|
...
...
...
...
...
...
...
...
...
...
INT8U opt,
...
INT8U opt,
INT8U *perr); | OS_OBJ_QTY |
|
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
Table C-12 Message Queue Management API
...
Panel |
---|
|
(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. |