FreeRTOS C-Addons  1.1.0
C-Addon functionality to FreeRTOS
Data Structures | Macros | Typedefs | Functions
stack_simple.h File Reference
#include "slist.h"
Include dependency graph for stack_simple.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Stack_t_
 

Macros

#define IsStackEmpty(_stack)   ((_stack)->Count == 0)
 

Typedefs

typedef struct Stack_t_ Stack_t
 

Functions

void InitStack (Stack_t *Stack)
 
void PushOnStack (Stack_t *Stack, SlNode_t *Node)
 
SlNode_tPopOffStack (Stack_t *Stack)
 

Macro Definition Documentation

◆ IsStackEmpty

#define IsStackEmpty (   _stack)    ((_stack)->Count == 0)
Returns
True if the stack is empty, false otherwise.

Definition at line 101 of file stack_simple.h.

Typedef Documentation

◆ Stack_t

typedef struct Stack_t_ Stack_t

The stack structure, we leverage low overhead singly linked lists here.

Function Documentation

◆ InitStack()

void InitStack ( Stack_t Stack)

Initialize a Stack structure you provide.

Parameters
StackPointer to your stack structure.

Definition at line 44 of file stack_simple.c.

◆ PopOffStack()

SlNode_t* PopOffStack ( Stack_t Stack)

Pop an item off the stack.

Note that you have to have embedded an SListNode inside your data structure.

Parameters
StackPointer to your stack structure.
Returns
An SListNode from the stack, or NULL if it's empty.

Definition at line 65 of file stack_simple.c.

◆ PushOnStack()

void PushOnStack ( Stack_t Stack,
SlNode_t Node 
)

Push an item onto the stack.

Note that you have to have embedded an SListNode inside your data structure.

Parameters
StackPointer to your stack structure.
NodeThe SListNode you want on the stack.

Definition at line 51 of file stack_simple.c.