FreeRTOS Emulator with SDL2 Based Graphics and Input Library  1.0
A POSIX wrapper to run FreeRTOS on an x86 machine with some basic input and output libraries aimed at making teaching FreeRTOS simpler.
states.c File Reference
#include <stdlib.h>
#include <string.h>
#include "ll.h"
#include "states.h"
#include "FreeRTOS.h"
#include "semphr.h"

Classes

struct  state
 Data object to store a single state's properties and functions. More...
 
struct  state_machine
 The state machine. More...
 

Typedefs

typedef struct state state_t
 
typedef struct state_machine state_machine_t
 

Functions

void vStatesSetCallback (void(*callback)(void))
 Sets the callback function for the state machine. More...
 
void vStatesSetData (void *data)
 Sets the data of the current state. More...
 
unsigned char uStatesSetState (unsigned int state_id)
 Sets the next state of the state machine using the state's ID. More...
 
void * pStatesGetData (void)
 Returns a pointer to the data stored in the current state. More...
 
char * pStatesGetStateName (void)
 Returns the string of the current state's name. More...
 
int xStatesGetStateID (void)
 Returns the ID of the current state. More...
 
int xStatesGetStateCount (void)
 Returns the number of states currently stored within the state machine. More...
 
int xStatesIncrementState (void)
 Increments the state to the next in the linked list of states. More...
 
int xStatesDecrementState (void)
 Decrements the state to the previous in the linked list of states. More...
 
unsigned char uStatesRun (void)
 Ticks the state machine over. More...
 
int xStatesAdd (void(*probe)(void), void(*enter)(void), void(*run)(void), void(*exit)(void), int ID, char *name)
 Adds a state to the state machine. More...
 
unsigned char uStatesInit (void)
 Initialized the states stored in the state machine by calling their probe functions, if set. More...
 

Variables

state_machine_t state_machine_dev = { 0 }
 

Detailed Description

Author
Alex Hoffman

Typedef Documentation

◆ state_machine_t

◆ state_t

typedef struct state state_t

Variable Documentation

◆ state_machine_dev

state_machine_t state_machine_dev = { 0 }