0% found this document useful (0 votes)
47 views

"ES - Configure.h" "ES - Types.h": #Ifndef Car - H #Define Car - H

This header file defines the state machine for a car based on an event-driven framework. It includes event definitions and type definitions for the car states, which include initializing, welcoming, waiting for placement, playing music, moving to end, resetting, and waiting for headphones. Function prototypes are provided for initializing the car, posting events to the car, running the car state machine, and checking the car's placement and limits.

Uploaded by

api-385142684
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

"ES - Configure.h" "ES - Types.h": #Ifndef Car - H #Define Car - H

This header file defines the state machine for a car based on an event-driven framework. It includes event definitions and type definitions for the car states, which include initializing, welcoming, waiting for placement, playing music, moving to end, resetting, and waiting for headphones. Function prototypes are provided for initializing the car, posting events to the car, running the car state machine, and checking the car's placement and limits.

Uploaded by

api-385142684
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

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

Header file for Car State Machine


based on the Gen2 Events and Services Framework

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

#ifndef Car_H
#define Car_H

// Event Definitions
#include "ES_Configure.h" /* gets us event definitions */
#include "ES_Types.h" /* gets bool type for returns */

// typedefs for the states


// State definitions for use with the query function
typedef enum
{
InitializingCar, WelcomeCar, WaitingForPlacement, MusicSequence, MovingToEnd,
CarResetting, WaitingForHeadphones
}CarState_t;

// Public Function Prototypes

bool InitCar(uint8_t Priority);


bool PostCar(ES_Event ThisEvent);
ES_Event RunCar(ES_Event ThisEvent);

bool CheckCarPlace(void);
bool CheckLimitEnd(void);
bool CheckLimitHome(void);

#endif /* Car_H */

You might also like