A queue functions as a fixed size FIFO for communication between tasks.
More...
#include <nbrtos.h>
Inherits OS_TASK_DLY_OBJ.
|
| OS_Q (void **pQueueStorage, uint8_t size) |
| Create and initialize a queue object. More...
|
|
uint8_t | Init (void **pQueueStorage, uint8_t size) |
| Sets the queue object to its initial state. More...
|
|
uint8_t | Post (void *pItem) |
| This function posts a message to a Queue. Note: Any higher priority task waiting on this queue will be started. More...
|
|
uint8_t | PostFirst (void *pItem) |
| This function posts a message like OSQPost, but posts the message at the head of the queue. Note: Any higher priority task waiting on this queue will be started. More...
|
|
uint8_t | PostUnique (void *pItem) |
| This function checks to see if a message already exists in a queue, and if it doesn't, it then posts it. Note: Any higher priority task waiting on this queue will be started. More...
|
|
uint8_t | PostUniqueFirst (void *msg) |
| This function checks to see if a message already exists in a queue, and if it doesn't, it then posts it at the head of the queue. Note: Any higher priority task waiting on this queue will be started. More...
|
|
void * | Pend (uint32_t timeoutTicks, uint8_t &result) |
| Wait timeout ticks for another task to post to the queue. Note: A timeout value of 0 (zero) waits forever. An err holds the error code if the function fails. More...
|
|
void * | PendNoWait (uint8_t &result) |
| Checks to see if a message has been posted to a queue, but does not wait. An err holds the error code if the function fails. More...
|
|
void * | Pend (uint32_t timeoutTicks=WAIT_FOREVER) |
| Wait timeout ticks for another task to post to the queue. This is the same as Pend(uint32_t timeoutTicks, uint8_t &result), but does not provide a result code. Note: A timeout value of 0 (zero) waits forever. More...
|
|
void * | PendNoWait () |
| Checks to see if a message has been posted to a queue, but does not wait. This is the same as PendNoWait(uint8_t &result), but does not provide an result code. More...
|
|
A queue functions as a fixed size FIFO for communication between tasks.
◆ OS_Q()
OS_Q::OS_Q |
( |
void ** |
pQueueStorage, |
|
|
uint8_t |
size |
|
) |
| |
|
inline |
Create and initialize a queue object.
- Parameters
-
pQueueStorage | A pointer to an array of (void *) pointers to hold queue messages. |
size | The number of pointers in the Q data storage area. |
◆ Init()
uint8_t OS_Q::Init |
( |
void ** |
pQueueStorage, |
|
|
uint8_t |
size |
|
) |
| |
Sets the queue object to its initial state.
- Parameters
-
pQueueStorage | A pointer to an array of (void *) pointers to hold queue messages. |
size | The number of pointers in the Q data storage area. |
- Return values
-
- See also
- NBRTOS Error Codes
◆ Pend() [1/2]
void * OS_Q::Pend |
( |
uint32_t |
timeoutTicks, |
|
|
uint8_t & |
result |
|
) |
| |
|
inline |
Wait timeout ticks for another task to post to the queue. Note: A timeout value of 0 (zero) waits forever. An err holds the error code if the function fails.
- Parameters
-
timeoutTicks | The number of time ticks to wait. |
&result | A variable to receive the result code (OS_NO_ERR if successful or OS_TIMEOUT if it fails). |
- Return values
-
Message | If successful |
NULL | If it timed out |
- See also
- NBRTOS Error Codes
-
PendNoWait(uint8_t &result)
-
Pend(uint32_t timeoutTicks)
◆ Pend() [2/2]
◆ PendNoWait() [1/2]
void * OS_Q::PendNoWait |
( |
| ) |
|
|
inline |
◆ PendNoWait() [2/2]
void * OS_Q::PendNoWait |
( |
uint8_t & |
result | ) |
|
Checks to see if a message has been posted to a queue, but does not wait. An err holds the error code if the function fails.
- Parameters
-
&result | A variable to receive the result code (OS_NO_ERR if successful or OS_TIMEOUT if it fails). |
- Return values
-
Message | If successful |
NULL | If it failed |
- See also
- NBRTOS Error Codes
-
Pend(uint32_t timeoutTicks, uint8_t &result)
-
PendNoWait()
◆ Post()
uint8_t OS_Q::Post |
( |
void * |
pItem | ) |
|
This function posts a message to a Queue. Note: Any higher priority task waiting on this queue will be started.
- Parameters
-
pItem | The message to be posted to the queue. |
- Return values
-
OS_NO_ERR | - If successful |
OS_Q_FULL | - If the queue is full and has no more room |
- See also
- NBRTOS Error Codes
-
PostFirst(void *pItem)
-
PostUnique(void *pItem)
◆ PostFirst()
uint8_t OS_Q::PostFirst |
( |
void * |
pItem | ) |
|
This function posts a message like OSQPost, but posts the message at the head of the queue. Note: Any higher priority task waiting on this queue will be started.
- Parameters
-
pItem | The message to be posted to the queue. |
- Return values
-
OS_NO_ERR | - Successfully posted at the head of the queue |
OS_Q_FULL | - The queue is already full; cannot post message |
- See also
- NBRTOS Error Codes
-
Post(void *pItem)
-
PostUniqueFirst(void *msg)
◆ PostUnique()
uint8_t OS_Q::PostUnique |
( |
void * |
pItem | ) |
|
This function checks to see if a message already exists in a queue, and if it doesn't, it then posts it. Note: Any higher priority task waiting on this queue will be started.
- Parameters
-
*pItem | The message to be posted to the queue |
- Return values
-
OS_NO_ERR | If successful |
OS_Q_EXISTS | If the message already exists in the queue |
OS_Q_FULL | If the queue is full and has no more room |
- See also
- NBRTOS Error Codes
-
Post(void *pItem)
-
PostUniqueFirst(void *msg)
◆ PostUniqueFirst()
uint8_t OS_Q::PostUniqueFirst |
( |
void * |
msg | ) |
|
This function checks to see if a message already exists in a queue, and if it doesn't, it then posts it at the head of the queue. Note: Any higher priority task waiting on this queue will be started.
- Parameters
-
*msg | Pointer to the message to be posted to the queue |
- Return values
-
OS_NO_ERR | If successful |
OS_Q_EXISTS | If the message already exists in the queue |
OS_Q_FULL | If the queue is full and has no more room |
- See also
- NBRTOS Error Codes
-
PostUnique(void *pItem)
-
PostFirst(void *pItem)
The documentation for this class was generated from the following files: