Table C-12 shows the difference in API for message-queue management.
µC/OS-II ( |
µC/OS-III ( |
Note |
|
|
(1) |
|
|
(2) |
|
|
|
|
|
|
|
|
(3) |
|
|
|
|
|
(4) |
|
|
|
|
|
(4) |
|
|
(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.