0% found this document useful (0 votes)
39 views1 page

Controlsm

This document contains function prototypes and typedefs for a control state machine (ControlSM) used in a game. It includes function prototypes for initializing and running the state machine, getting the current state, and checking for specific events. It also defines an enumerated type for the different states of the state machine, including welcoming, setup, reading difficulty, and in-game states.

Uploaded by

api-438010548
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views1 page

Controlsm

This document contains function prototypes and typedefs for a control state machine (ControlSM) used in a game. It includes function prototypes for initializing and running the state machine, getting the current state, and checking for specific events. It also defines an enumerated type for the different states of the state machine, including welcoming, setup, reading difficulty, and in-game states.

Uploaded by

api-438010548
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

/****************************************************************************

Header file for ControlSM.c


based on the Gen 2 Events and Services Framework

****************************************************************************/

#ifndef ControlSM_H
#define ControlSM_H

#include <stdint.h>
#include <stdbool.h>

#include "ES_Events.h" //to give definition on the states

#define INACTIVE_TIMER 0

// typedefs for the states


// State definitions for use with the query function
typedef enum
{
PseudoState_Control,
Welcoming,
Setup,
ReadingDifficulty,
Resetting,
InGame,
Ending,
MovingMarioBack
}ControlSM_States_t;

// Public Function Prototypes

bool InitControlSM(uint8_t Priority);


bool PostControlSM(ES_Event_t ThisEvent);
ES_Event_t RunControlSM(ES_Event_t ThisEvent);
bool ReadDifficulty(void);
ControlSM_States_t getControlSM_State(void);

//event checker functions


bool CheckMarioStart(void);
bool CheckMarioEnd(void);
bool CheckFlagUp(void);
bool CheckFlagDown(void);
bool Check_FlagDown_AND_MarioStart(void);
bool CheckDifficultyChange(void);
bool StartButton_check(void);

#endif /* ControlSM_H */

You might also like