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.
state_machine.h File Reference

Util functions for creating and running a basic state machine based off of the state machine implementation found in states.h. More...

#include "FreeRTOS.h"
#include "queue.h"

Go to the source code of this file.

Macros

#define STARTING_STATE   STATE_ONE
 
#define STATE_DEBOUNCE_DELAY   300
 
#define STATE_QUEUE_LENGTH   1
 
#define STATE_ONE   0
 
#define STATE_TWO   1
 
#define STATE_MACHINE_PERIOD   10
 

Functions

int vCheckStateInput (void)
 Checks if the button C was pressed and if so increments the system's state. More...
 
void vStateMachineTask (void *pvParameters)
 Function to be run as the state machine's task, orchestrates a periodic call to states run. More...
 
int xStateMachineInit (void)
 Initialized the states for the state machine. More...
 

Detailed Description

Util functions for creating and running a basic state machine based off of the state machine implementation found in states.h.

Author
Alex Hoffman
Date
23 January 2023
----------------------------------------------------------------------
Copyright (C) Alexander Hoffman, 2023
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
----------------------------------------------------------------------

Macro Definition Documentation

◆ STARTING_STATE

#define STARTING_STATE   STATE_ONE

◆ STATE_DEBOUNCE_DELAY

#define STATE_DEBOUNCE_DELAY   300

◆ STATE_MACHINE_PERIOD

#define STATE_MACHINE_PERIOD   10

◆ STATE_ONE

#define STATE_ONE   0

◆ STATE_QUEUE_LENGTH

#define STATE_QUEUE_LENGTH   1

◆ STATE_TWO

#define STATE_TWO   1

Function Documentation

◆ vCheckStateInput()

int vCheckStateInput ( void  )

Checks if the button C was pressed and if so increments the system's state.

Returns
0 on success

◆ vStateMachineTask()

void vStateMachineTask ( void *  pvParameters)

Function to be run as the state machine's task, orchestrates a periodic call to states run.

Parameters
pvParameters

◆ xStateMachineInit()

int xStateMachineInit ( void  )

Initialized the states for the state machine.

Returns
0 on success