Skip to content

Commit ffd1c03

Browse files
committed
RTOS: Queue: Improve API docs
1 parent aae62bd commit ffd1c03

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

rtos/Queue.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,24 @@ class Queue : private mbed::NonCopyable<Queue<T, queue_sz> > {
6868
@param data message pointer.
6969
@param millisec timeout value or 0 in case of no time-out. (default: 0)
7070
@param prio priority value or 0 in case of default. (default: 0)
71-
@return status code that indicates the execution status of the function.
71+
@return status code that indicates the execution status of the function:
72+
@a osOK the message has been put into the queue.
73+
@a osErrorTimeout the message could not be put into the queue in the given time.
74+
@a osErrorResource not enough space in the queue.
75+
@a osErrorParameter internal error or non-zero timeout specified in an ISR.
7276
*/
7377
osStatus put(T* data, uint32_t millisec=0, uint8_t prio=0) {
7478
return osMessageQueuePut(_id, &data, prio, millisec);
7579
}
7680

77-
/** Get a message or Wait for a message from a Queue.
81+
/** Get a message or Wait for a message from a Queue. Messages are retrieved in a descending priority order or
82+
first in first out when the priorities are the same.
7883
@param millisec timeout value or 0 in case of no time-out. (default: osWaitForever).
79-
@return event information that includes the message and the status code.
84+
@return event information that includes the message in event.value and the status code in event.status:
85+
@a osEventMessage message received.
86+
@a osOK no message is available in the queue and no timeout was specified.
87+
@a osEventTimeout no message has arrived during the given timeout period.
88+
@a osErrorParameter a parameter is invalid or outside of a permitted range.
8089
*/
8190
osEvent get(uint32_t millisec=osWaitForever) {
8291
osEvent event;

0 commit comments

Comments
 (0)