NetBurner 3.3.4
PDF Version
OS_FIFO Class Reference

A FIFO is used to pass structures from one task to another. Note: Structures to be passed must have an unused (void *) pointer as its first element. This precludes passing C++ objects with virtual member functions. More...

#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. More...
 
uint8_t Post (OS_FIFO_EL *pToPost)
 This function posts to a FIFO object. More...
 
uint8_t PostFirst (OS_FIFO_EL *pToPost)
 This function is identical to Post(), but the element posted is put on the beginning of the FIFO list. More...
 
OS_FIFO_EL * Pend (uint32_t timeoutTicks, uint8_t &result)
 This function pends on a FIFO for a specified number of ticks. More...
 
OS_FIFO_EL * PendNoWait (uint8_t &result)
 Checks to see if a structure has been posted to a FIFO, but does not wait. More...
 
OS_FIFO_EL * Pend (uint32_t timeoutTicks=WAIT_FOREVER)
 This function pends on a FIFO for a specified number of ticks. This is the same as Pend(uint32_t timeoutTicks, uint8_t &result), but does not provide a result code. More...
 
OS_FIFO_EL * PendNoWait ()
 Checks to see if a structure has been posted to a FIFO, but does not wait. This is the same as PendNoWait(uint8_t &result), but does not provide a result code. More...
 

Detailed Description

A FIFO is used to pass structures from one task to another. Note: Structures to be passed must have an unused (void *) pointer as its first element. This precludes passing C++ objects with virtual member functions.

Member Function Documentation

◆ Init()

uint8_t OS_FIFO::Init ( )

Sets the FIFO object to its initial state.

Return values
OS_NO_ERR- If successful
See also
NBRTOS Error Codes

◆ Pend() [1/2]

OS_FIFO_EL * OS_FIFO::Pend ( uint32_t  timeoutTicks,
uint8_t &  result 
)

This function pends on a FIFO for a specified number of ticks.

Parameters
timeoutTicksThe number of time ticks to wait.
[out]resultA variable to receive the result code (OS_NO_ERR if successful or OS_TIMEOUT if it fails).
Return values
StructureIf successful
NULLIf it timed out
See also
NBRTOS Error Codes
PendNoWait(uint8_t &result)
Pend(uint32_t timeoutTicks)

◆ Pend() [2/2]

OS_FIFO_EL* OS_FIFO::Pend ( uint32_t  timeoutTicks = WAIT_FOREVER)
inline

This function pends on a FIFO for a specified number of ticks. This is the same as Pend(uint32_t timeoutTicks, uint8_t &result), but does not provide a result code.

Parameters
timeoutTicksThe number of time ticks to wait.
Return values
StructureIf successful
NULLIf it timed out
See also
PendNoWait()
Pend(uint32_t timeoutTicks, uint8_t &result)

◆ PendNoWait() [1/2]

OS_FIFO_EL* OS_FIFO::PendNoWait ( )
inline

Checks to see if a structure has been posted to a FIFO, but does not wait. This is the same as PendNoWait(uint8_t &result), but does not provide a result code.

Return values
StructureIf successful
NULLIf it failed
See also
Pend(uint32_t timeoutTicks)
PendNoWait(uint8_t &result)

◆ PendNoWait() [2/2]

OS_FIFO_EL * OS_FIFO::PendNoWait ( uint8_t &  result)

Checks to see if a structure has been posted to a FIFO, but does not wait.

Parameters
[out]resultA variable to receive the result code (OS_NO_ERR if successful or OS_TIMEOUT if it fails).
Return values
StructureIf successful
NULLIf it failed
See also
NBRTOS Error Codes
Pend(uint32_t timeoutTicks, uint8_t &result)
PendNoWait()

◆ Post()

uint8_t OS_FIFO::Post ( OS_FIFO_EL *  pToPost)

This function posts to a FIFO object.

Parameters
pToPostA pointer to the user's structure cast as an OS_FIFO_EL to be posted to the FIFO.
Return values
OS_NO_ERR- If successful
See also
NBRTOS Error Codes
PostFirst(OS_FIFO_EL *pToPost)

◆ PostFirst()

uint8_t OS_FIFO::PostFirst ( OS_FIFO_EL *  pToPost)

This function is identical to Post(), but the element posted is put on the beginning of the FIFO list.

The task that pends next will get the structure/object posted here, instead of any prior objects posted to the FIFO.

Parameters
pToPostA pointer to the user's structure cast as an OS_FIFO_EL to be posted to the FIFO.
Return values
OS_NO_ERR- If successful
See also
NBRTOS Error Codes
Post(OS_FIFO_EL *pToPost)

The documentation for this class was generated from the following files: