NetBurner 3.5.0
PDF Version |
|
#include <nbrtos.h>
Inherits OS_TASK_DLY_OBJ.
Public Member Functions | |
OS_FIFO () | |
Create and initialize a FIFO object. | |
uint8_t | Init () |
Sets the FIFO object to its initial state. | |
uint8_t | Post (OS_FIFO_EL *pToPost) |
Post a message to the next available location in the FIFO. | |
uint8_t | PostFirst (OS_FIFO_EL *pToPost) |
Post a message to the head of the FIFO. | |
OS_FIFO_EL * | Pend (uint32_t timeoutTicks, uint8_t &result) |
Wait the specified number of time ticks for some other task to post to the FIFO. | |
OS_FIFO_EL * | Pend (TickTimeout &t, uint8_t &result) |
Wait the specified number of TickTimeout ticks for some other task to post to the FIFO. | |
OS_FIFO_EL * | Pend (uint32_t timeoutTicks=WAIT_FOREVER) |
Pend on a FIFO for the specified number of system TimeTicks. | |
OS_FIFO_EL * | PendUntil (uint32_t timeoutTime, uint8_t &result) |
Wait the specified TimeTicks value for some other task to post to the FIFO. | |
OS_FIFO_EL * | PendNoWait (uint8_t &result) |
Attempts to pend a structure to the FIFO, but does not wait. | |
OS_FIFO_EL * | PendNoWait () |
Attempts to pend a structure to the FIFO, but does not wait. | |
A FIFO is similar to a queue, but is specifically designed to pass pointers to OS_FIFO structures. The first parameter of the structure must be a (void *) element, which is used by the operating system to create a linked list of FIFOs. When initializing a FIFO, you do not specify the maximum number of entries as with a queue. Instead, your application has the ability (and responsibility) to allocate memory (static or dynamic) in which to store the structures. This can be done statically by declaring global variables, or dynamically by allocating memory from the heap. As with a queue, the first message posted to the FIFO will be the first message extracted from the queue.
|
inline |
Create and initialize a FIFO object.
uint8_t OS_FIFO::Init | ( | ) |
Sets the FIFO object to its initial state.
OS_FIFO_EL * OS_FIFO::Pend | ( | TickTimeout & | t, |
uint8_t & | result ) |
Wait the specified number of TickTimeout ticks for some other task to post to the FIFO.
t | The number of system ticks to wait. A value of 0 will wait forever. |
result | Reference to store the status of the function call, NBRTOS Error Codes. OS_NO_ERR if successful, OS_TIMEOUT if it timed out. |
OS_FIFO_EL | Pointer to OS_FIFO_EL if successful |
NULL | If it timed out |
|
inline |
Wait the specified number of time ticks for some other task to post to the FIFO.
timeoutTicks | The number of system ticks to wait. A value of 0 will wait forever. |
result | Reference to store the status of the function call, NBRTOS Error Codes. OS_NO_ERR if successful, OS_TIMEOUT if it timed out. |
OS_FIFO_EL | Pointer to OS_FIFO_EL if successful |
NULL | If it timed out |
|
inline |
Pend on a FIFO for the specified number of system TimeTicks.
timeoutTicks | The number of system TimeTicks to wait. If not specified, will wait forever. |
OS_FIFO_EL | Pointer to OS_FIFO_EL if successful |
NULL | If it timed out |
|
inline |
Attempts to pend a structure to the FIFO, but does not wait.
OS_FIFO_EL | Pointer to OS_FIFO_EL if successful |
NULL | If it timed out |
OS_FIFO_EL * OS_FIFO::PendNoWait | ( | uint8_t & | result | ) |
Attempts to pend a structure to the FIFO, but does not wait.
result | Reference to store the status of the function call, NBRTOS Error Codes. OS_NO_ERR if successful, OS_TIMEOUT if it timed out. |
OS_FIFO_EL | Pointer to OS_FIFO_EL if successful |
NULL | If it timed out |
|
inline |
Wait the specified TimeTicks value for some other task to post to the FIFO.
timeoutTime | The value of system TimeTicks to wait for |
result | Reference to store the status of the function call, NBRTOS Error Codes. OS_NO_ERR if successful, OS_TIMEOUT if it timed out. |
OS_FIFO_EL | Pointer to OS_FIFO_EL if successful |
NULL | If it timed out |
uint8_t OS_FIFO::Post | ( | OS_FIFO_EL * | pToPost | ) |
Post a message to the next available location in the FIFO.
pToPost | A pointer to the structure cast as an OS_FIFO_EL to be posted to the FIFO. |
OS_NO_ERR | If successful |
OS_Q_FULL | If the queue is full, NBRTOS Error Codes |
uint8_t OS_FIFO::PostFirst | ( | OS_FIFO_EL * | pToPost | ) |
Post a message to the head of the FIFO.
pToPost | A pointer to the user's structure cast as an OS_FIFO_EL to be posted to the FIFO. |
OS_NO_ERR | If successful |
OS_Q_FULL | If the queue is full, NBRTOS Error Codes |